Question: Write a Guess My Number Game program. The program generates a random integer in a specified range. and the user (the player) has to guess

Write a "Guess My Number Game" program. The program generates a random integer in a specified range. and the user (the player) has to guess the number. The program allows the user to play as many times as he/she would like: at the conclusion of each game. the program asks whether the player wants to play again.

The basic algorithm is:

1. The program starts by printing instructions on the screen.

2. For every game:

  • The program generates a new random integer in the range from MIN to MAX. Treat MIN and MAX like constants: start by initializing them to 1 and 100.
  • Loop to prompt the player for a guess until the player correctly guesses the integer.
  • For each guess. the program prints whether the players guess was too low, too high or correct.
  • At the conclusion (when the integer has been guessed):
  • Print the total number of guesses for that game
  • Print a message regarding how well the player did in that game (e.g the player took way too long to guess the number, the player was awesome. etc.). To do this, you will have to decide on ranges for your messages and give a rationale for your decision in a comment in the program.

3. After all games have been played, print a summary showing the average number of guesses.

Step by Step Solution

3.46 Rating (153 Votes )

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock

Certainly Lets break down the Guess My Number Game program into detailed steps and explain how you might write the program to meet all the requirement... View full answer

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 Programming Questions!