Question: Write a JAVA program that plays a number guessing game with the user. A sample run for the game follows. User input is shown in

Write a JAVA program that plays a number guessing game with the user. A sample run for the game follows. User input is shown in boldface in the sample run.

Welcome to the game of Guess It! I will choose a number between 1 and 100. You will try to guess that number. If your guess wrong, I will tell you if you guessed too high or too low. You have 6 tries to get the number.

OK, I am thinking of a number. Try to guess it.

Your guess? 50 Too high! Your guess? 112 Illegal guess. Your guess must be between 1 and 100. Try again. Your guess? 23

**** CORRECT ****

Want to play again? N Good bye, it was fun. Play again soon.

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!