Question: Write a program that asks the user to input 5 positive integers. Have your program throw exceptions if any given values are negative, and protect
Write a program that asks the user to input 5 positive integers. Have your program throw exceptions if any given values are negative, and protect against non-integer inputs. If the user fails on any of the five inputs they will need to input that one again. After 5 successful inputs report the average to the screen. You need to use a loop here, do not just write the same code out 5 times.
Java.
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
