Question: C++ Question 5: (25 points) Write a C++ program to sort integer numbers in either ascending or descending order, e.g. 9, 12, 4 will be
Question 5: (25 points) Write a C++ program to sort integer numbers in either ascending or descending order, e.g. 9, 12, 4 will be sorted to 4, 8, 12 (ascending order) and 12, 9, 4 (descending order). In your program you may first ask the user if he wants to sort in ascending or descending order. Then ask the user to input up to 50 nonnegative whole numbers to be sorted followed by a -1 to indicate the user finished inputting the numbers. At the end of the program you will display to the user the set of numbers he/she has entered and the sorted version of it either in ascending or descending order, whatever he/she has chosen. Hint: you may use an array or a vector to store the input variables
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
