Answered step by step
Verified Expert Solution
Question
1 Approved Answer
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
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started