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