0

Arranging an array from greatest to least

I'm looking to get inputs into an array, then rearrange those inputs from greatest to least and output the new array. OR take the inputs in an array and list them from greatest to least without rearranging the array. For reference, the third part is what I'm trying to achieve. You can see the codes for the first two parts in my codes. Thanks! "Write a program that asks the user to enter the number of pancakes eaten for breakfast by 10 different people (Person 1, Person 2, ..., Person 10) Once the data has been entered the program must analyze the data and output which person ate the most pancakes for breakfast. ★ Modify the program so that it also outputs which person ate the least number of pancakes for breakfast. ★★★★ Modify the program so that it outputs a list in order of number of pancakes eaten of all 10 people. i.e. Person 4: ate 10 pancakes Person 3: ate 7 pancakes Person 8: ate 4 pancakes ... Person 5: ate 0 pancakes"

13th May 2017, 6:00 AM
James Aaron
James Aaron - avatar
1 Odpowiedź
+ 3
use sorting algorithm . bubble sort , insertion sort ......
13th May 2017, 6:03 AM
MR Programmer
MR Programmer - avatar