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
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