Question: Java Programming Design and implement a program that reads a series of integers from the user and continually prints their average after every reading. The
Java Programming
Design and implement a program that reads a series of integers from the user and continually prints their average after every reading. The input stops when the user enters stop as the input value. Read each input value as a string, then check if it is stop or not. If the string is not stop, then, attempt to convert it to an integer using the Integer.parseInt method. If this process throws a NumberFormatException, meaning that the input is not a valid integer, display an appropriate error message and prompt for the number again. Continue reading values until the string stop has been entered.
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
