Question: Implement a number guessing game where a player will get up to seven chances to guess a mystery number in the range of 1 through

Implement a number guessing game where a player will get up to seven chances to guess a mystery number in the range of 1 through 100. At the beginning of the game, the program will generate a random number in the range 1 through 100. It will then prompt the player to guess the number. If the user's guess is: Higher than the random number => the program will display "Too High ...". Lower than the random number => the program will display "Too Low ... ". The same as the random number => the program will congratulate the player. The program allows up to seven rounds per game. The player can play as many games as they wish. The following functions must be included in the implementation. They will be called from main(): getGuess(first, last) Prompt user for a number in the range first to last (inclusive) and return it. Input Validation. Make sure that the number entered is in the range [first, last]. Loop until valid. guessWin(number, guess) Compare the mystery number against the player's guess. If guess > number -> display "Too High ..." If guess display "Too Low ..." If guess == number -> congratulate player Return True if the player guessed the mystery number, False otherwise Note Define the number of rounds per game as a constant so it can easily be adjusted to make the game more or less challenging. Output Samples Guess the Mystery Number . . . Round 1 of 7 Enter your guess (1-100) : 50 - -> 50 is too High Round 2 of 7 Enter your guess (1-100) : 30 30 is too Low . . . Round 3 of 7 Enter your guess (1-100) : 40 40 is too Low
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
