|
|
|
|
|
|
Using BREAK could help? or CONTINUE, but these are only to be used in switches |
|
|
That comes second thoough, first I need to stop the loop from running automatically... any hints for this? |
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 outputs a list in order of number of pancakes eaten of all 10 people. |
|
|
★ Modify the program so that it also outputs which person ate the least number of pancakes for breakfast. |
|
|
Person 1 had how many pancakes? 1 Person 2 had how many pancakes? 3 Person 3 had how many pancakes? 5 Person 4 had how many pancakes? 7 Person 5 had how many pancakes? 9 Person 6 had how many pancakes? 8 Person 7 had how many pancakes? 6 Person 8 had how many pancakes? 4 Person 9 had how many pancakes? 2 Person 10 had how many pancakes? 4 The person who ate the most pancakes was #5 |
Person 1 had how many pancakes? -1 Person 2 had how many pancakes? 0 Person 3 had how many pancakes? 0 Person 4 had how many pancakes? 0 Person 5 had how many pancakes? 0 Person 6 had how many pancakes? 0 Person 7 had how many pancakes? 0 Person 8 had how many pancakes? 0 Person 9 had how many pancakes? 0 Person 10 had how many pancakes? 0 The person who ate the most pancakes was #1 |
No one can eat 4294967295 pancakes, either. |