Question: I need Java program for this Write a program that reads 5 numbers. It prints the total. Your program must handle the exception and makes
I need Java program for this Write a program that reads numbers. It prints the total.
Your program must handle the exception and makes the user reinput the number.
Hint: the exception that can occur is java.util.InputMismatchException
You are provided the code to read numbers. Modify it to handle exceptions describe above.
Sample run
Enter a number:
Enter a number: a
Input must be a integer.
Enter a number:
Enter a number: hello
Input must be a integer.
Enter a number:
Enter a number:
Enter a number: world
Input must be a integer.
Enter a number:
total
Step by Step Solution
There are 3 Steps involved in it
1 Expert Approved Answer
Step: 1 Unlock
Question Has Been Solved by an Expert!
Get step-by-step solutions from verified subject matter experts
Step: 2 Unlock
Step: 3 Unlock
