Question: Write a Java application called GradedExercise1 that fulfills this specification. Ask the user for their age. If their age is between greater than and less

Write a Java application called GradedExercise1 that fulfills this specification. Ask the user for their age. If their age is between greater than and less than 100, the program outputs:

Your age is: (whatever the user has entered).

And the program ends.

If the user enters a number which is less than 1 or greater than 100, the program outputs the following, and continues to accept input from the user until the user enters an age between 1 and 100.

java.util.InputMismatchException: You must enter a valid age.

Invalid age. Please try again.

Please enter your age:

Be sure to comment your code.

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!