Asked by Vlad
Create a Sales application that prompts the user for a series of sales figures and then implements a sorting routine on the sales figures.
Output.
Enter the number of sales made today: 15
Enter the amount of sales 1:25
Enter the amount of sales 2:65
Enter the amount of sales 3:25
Enter the amount of sales 4:15
Enter the amount of sales 5:2
Sorted amounts:
2 15 25 25 65
Output.
Enter the number of sales made today: 15
Enter the amount of sales 1:25
Enter the amount of sales 2:65
Enter the amount of sales 3:25
Enter the amount of sales 4:15
Enter the amount of sales 5:2
Sorted amounts:
2 15 25 25 65
Answers
Answered by
MathMate
Which sorting algorithm do you plan to use?
For small number of items (less than 200),
bubble sort is easy to understand and code using for-loops.
For large number of random items, quick sort could be used, but requires the understanding of recursivity.
For small number of items (less than 200),
bubble sort is easy to understand and code using for-loops.
For large number of random items, quick sort could be used, but requires the understanding of recursivity.
There are no AI answers yet. The ability to request AI answers is coming soon!