Question: Review of Selection and Repetition Statements Write a Java Program to allow a user to guess a persons age until they get it correct. After

Review of Selection and Repetition Statements

Write a Java Program to allow a user to guess a persons age until they get it correct. After each guess, the user must be told whether their guess was correct, too high, or too low. Once the user enters the correct age, the program must display how many guesses it took the user to guess the correct age.

Example Output:

How old is Jack? 19 Too low, guess again

How old is Jack? 25 Too high, guess again

How old is Jack? 20 Too low, guess again

How old is Jack? 21 Correct! It took you 4 guesses to get it right.

PLEASE FOLLOW THE INSTRUCTIONS AND THE EXAMPLE OUTPUT GIVEN!!!

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!