Question: a 4.) Write a RAPTOR program that asks the user to enter five numbers and then outputs the largest number that the user entered. This
a 4.) Write a RAPTOR program that asks the user to enter five numbers and then outputs the largest number that the user entered. This time, use a loop to read the numbers. Hint: To solve this problem, you'll need a variable to keep track of the largest number so far. You might call the variable largestSoFar. Each time you read a new number from the user, check if that number is larger than the largestSoFar (using a Selection symbol), and, if it is, update that you have found a new largestSoFar. Sample run (user input in blue, master console output shown in orange): Enter a number: 10 Enter a number: 12 Enter a number: 3 Enter a number: 42 Enter a number: 12 The largest number was 42
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
