Question: Java: Create a program that reads 10 integers from the user and prints their average: a) Prompt the user one at a time to enter
Java: Create a program that reads 10 integers from the user and prints their average:
a) Prompt the user one at a time to enter a number reading the input from the user as a string.
b) Convert it to an integer using Integer.parseInt method.
c) Use throw NumberFormatException, printing an error message to try again to the user.
d) Continue the prompt till all 10 integers are read and print the average of the 10 numbers.
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
