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

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!