C++ PROGRAMMING
Develop a program that will sort the elements of a single dimension array.
Program Requirements:
1. Declare a single dimension array of size n
2. Input n elements to a single dimension array
3. Sort the elements of an array from highest to lowest and vice versa Also, the program will identify and output the highest and lowest integer.
Sorting Arrays
Number of items to sort: 10
Enter elements
10 0 5 13 -10 20 -89 101 96 3
Lowest _> Highest
-89 -10 0 3 5 10 13 20 96 101
Highest _> Lowest
101 96 20 13 10 5 3 0 -10 -89
Highest = 101 Lowest = -8
Questions:
1. What is the algorithm used to sort elements of array in ascending and descending order?
2. How many integer arrays were used in this program?
3. Can this program be done with only 1 integer array being used? Explain your answer.
4. Explain how was the program able to determine the highest and lowest element.