Question: In basic C++ please. Write a program that takes a list of integers as input. The input begins with an integer indicating the number of

In basic C++ please.

Write a program that takes a list of integers as input. The input begins with an integer indicating the number of integers that follow. You can safely assume that the number of integers entered is always less than or equal to 10. The program then determines whether these integers are sorted in the ascending order (i.e., from the smallest to the largest). If these integers are sorted in the ascending order, the program will output Sorted; otherwise, it will output Unsorted.

Ex: if the user enters:

7 1 3 4 2 4 5 7 

the program will output:

Unsorted 

If the user enters:

7 1 2 4 5 7 9 10 

the program will output:

Sorted 

You MUST define and call the following function to determine whether the integers are sorted in the ascending order or not. This function will take the array of the integers and its size as input and return a boolean value with true indicating sorted and false for unsorted.

bool isSorted(int array[], int size);

Any attempt to hard code answers will result in a 0 for the exercise.

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!