Question
Program #1 (13 points): Design and implement a Java class (name it MismatchException) to determine the average of three integer numbers. The program must include
Program #1 (13 points): Design and implement a Java class (name it MismatchException) to determine the average of three integer numbers. The program must include a try-and-catch exception handling block to detected invalid inputs (InputMismatchException). If an invalid input value is detected, the program prompts the user to re-enter valid numbers. The program does not proceed until valid integer values were entered. The following are sample runs to illustrate required output formatting.
Enter three integers: 1 2 3
Numbers: 1, 2, 3
Average: 2.00
Enter three integers: 1 2 3.5
Incorrect input, re-enter three integers: 1 2.5 3
Incorrect input, re-enter three integers: 1 x false Incorrect input, re-enter three integers: a b c
Incorrect input, re-enter three integers: John Ed 3
Incorrect input, re-enter three integers: 1 2 3
Numbers: 1, 2, 3
Average: 2.00
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