This question is for java. Write a program that plays the Hi-Lo guessing game with numbers. The program should pick a random number between 1 and 100 (inclusive), then repeatedly prompt the user to guess the number. On each guess, report to the user that he or she is correct or that the guess is high or low. Continue accepting guesses until the user guesses correctly or chooses to quit. Use a sentinel value to determine whether the user wants to quit. Count the number of guesses and report that value when the user guesses correctly. At the end of each game (by quitting or a cor- rect guess), prompt to determine whether the user wants to play again. Continue playing games until the user chooses to stop.
This question is for java.
Write a
numbers. The program should pick a random number between
1 and 100 (inclusive), then repeatedly prompt the user to guess
the number. On each guess, report to the user that he or she
is correct or that the guess is high or low. Continue accepting
guesses until the user guesses correctly or chooses to quit. Use
a sentinel value to determine whether the user wants to quit.
Count the number of guesses and report that value when the user
guesses correctly. At the end of each game (by quitting or a cor-
rect guess), prompt to determine whether the user wants to play
again. Continue playing games until the user chooses to stop.
Trending now
This is a popular solution!
Step by step
Solved in 2 steps with 2 images