Question: Problem 1. (Guessing Game) In this problem you will be creating a game that you play against the computer. Make a class named GuessingGame -

Problem 1. (Guessing Game) In this problem you will be creating a game that you play against the computer. Make a class named GuessingGame - when executed, this program should randomly generate a secret integer from 1 to 100, and then instruct the user to try to guess what it is. After each guess the program will tell them if they are too high, too low, or if they got it right - and if they got it right it will congratulate them, tell them how many guesses it took them, and offer to either play again or exit the program.

An example interaction with this program follows: ----------------------------------------Please guess a number between 1 and 100: 50 Too low! Guess again: 75 Too high! Guess again: 63 Good job, you got it after 3 guesses! Want to play again (Y or N)? N Thanks for playing!

language: Java

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!