Page 1 of 1

Please write in Java: 1. Guess number. Write a program to: a. Generate a random integer between 1 and 100 (inclusive) an

Posted: Fri Jul 01, 2022 5:34 am
by answerhappygod
Please write in Java:
1. Guess number. Write a program to:
a. Generate a random integer between 1 and 100 (inclusive) andprompt user to guess the number.
b. If the guess is not right, give the user the hint like“higher”, “lower”. Allow the user to retry and input the newguess
. c. Likely you want to use a while loop to support the user’smultiple attempts. Stop the loop when the user guessed the correctnumber.
d. Print out the number of attempts for the user for this roundof game.
e. Allow one to play the guess number games as many times as onewants. Make sure one has a way to stop the application (e.g. byinputting a special string “no” when asked about whether one wantto print the game again.