Question: Using C++.. Create a game call Guess That Number! The program has an unlimited number of rounds. In each round the program selects a random

Using C++..

Create a game call Guess That Number! The program has an unlimited number of rounds. In each round the program selects a random number that the user has to guess.

In Round 1 the user has to guess a number less than 5 within 5 tries. If the correct number is not guessed in 5 tries than the game is over. If the correct number is guessed than the user moves onto the next round where he/she has to guess a number less than 10 within 5 tries. In each subsequent round the range of numbers is doubled (5, 10, 20, 40, etc.).

In order to program this game you will need to use if-else statements, loops and random number generation using the cmath and ctime libraries.

Output/Input:

---------------------------------- Welcome to Guess That Number! ----------------------------------

Round 1 Guess a number less than 5: 1

Incorrect! try again (4 tries remaining)

Guess a number less than 5: 2

Incorrect! try again (3 tries remaining)

Guess a number less than 5: 0

Incorrect! try again (2 tries remaining)

Guess a number less than 5: 3

Incorrect! try again (1 tries remaining)

Guess a number less than 5: 4 Correct! The number was 4

Round 2 Guess a number less than 10: 4

Incorrect! try again (4 tries remaining)

Guess a number less than 10: 6

Incorrect! try again (3 tries remaining)

Guess a number less than 10: 1

Incorrect! try again (2 tries remaining)

Guess a number less than 10: 2

Incorrect! try again (1 tries remaining)

Guess a number less than 10: 7

Correct! The number was 7

Round 3 Guess a number less than 20: 0

Incorrect! try again (4 tries remaining)

Guess a number less than 20: 1

Incorrect! try again (3 tries remaining)

Guess a number less than 20: 2

Incorrect! try again (2 tries remaining)

Guess a number less than 20: 3 I

ncorrect! try again (1 tries remaining)

Guess a number less than 20: 4

Incorrect! Out of guesses :(

Game Over!!!

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!