Answered step by step
Verified Expert Solution
Question
1 Approved Answer
Write a Java program which reads a series of 1 0 integers and find their average. Please notice your program should satisfy the following requirements:
Write a Java program which reads a series of integers and find their average.
Please notice your program should satisfy the following requirements:
Read each input value as a string, and then convert it to an integer.
However, once you catch an invalid integer, you should throw an exception, and print an appropriate error message to remind the customer to reenter a new string which can be converted into a valid integer.
Continue reading values until valid strings are read.
Implement trycatch statement to handle the exception in your program.
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