Question: Write a program in JAVA that will ask the user to enter 7 random numbers from 1 to 20. The numbers should be separated by

Write a program in JAVA that will ask the user to enter 7 random numbers from 1 to 20. The numbers should be separated by space and the last number should be a zero to indicate end of number list. Hint: Use a while statement to accept user input and an if statement to determine maximum value.

Display the total of the seven numbers. Display the maximum value of the seven numbers.

Example: Enter a number from 1 to 20 separated by space. When done enter 0.

Test your code by enter the following values: 1 5 7 3 11 9 8 0

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!