Create a C++ game that would have an output that is given in the picture. First loop in the game needs to include: the user to choose a number between 1 and 100. and the user is only allowed 6 tries in the game.  Second loop needs to ask the player if they want to play again answering with a character 'Y' or 'N'.

Database System Concepts
7th Edition
ISBN:9780078022159
Author:Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Publisher:Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Chapter1: Introduction
Section: Chapter Questions
Problem 1PE
icon
Related questions
Question

Create a C++ game that would have an output that is given in the picture.

First loop in the game needs to include: the user to choose a number between 1 and 100. and the user is only allowed 6 tries in the game. 

Second loop needs to ask the player if they want to play again answering with a character 'Y' or 'N'.

**Game Description: Guess It!**

**Objective:** 
Guess the number chosen by the computer.

**Instructions:**

1. The computer will pick a random number between 1 and 100.
2. You have six attempts to guess the number.
3. After each guess, you will receive feedback:
   - "Too high!" if your guess is greater than the chosen number.
   - "Too low!" if your guess is less than the chosen number.
4. The number must be between 1 and 100 (inclusive). Any attempts outside of this range are considered illegal guesses.

**Sample Game Run:**

- **Computer:** OK, I am thinking of a number. Try to guess it.
- **Player's Guess:** 50
  - **Feedback:** Too high!
- **Player's Guess:** 112
  - **Feedback:** Illegal guess. Your guess must be between 1 and 100.
- **Player's Guess:** 23
  - **Feedback:** **** CORRECT ****

**After the Game:**

- **Computer:** Want to play again?
- **Player's Response:** N
  - **Feedback:** Good bye, it was fun. Play again soon. 

**Notes:**
- The game is straightforward, with user input displayed in bold.
- Have fun while improving your number-guessing skills!
Transcribed Image Text:**Game Description: Guess It!** **Objective:** Guess the number chosen by the computer. **Instructions:** 1. The computer will pick a random number between 1 and 100. 2. You have six attempts to guess the number. 3. After each guess, you will receive feedback: - "Too high!" if your guess is greater than the chosen number. - "Too low!" if your guess is less than the chosen number. 4. The number must be between 1 and 100 (inclusive). Any attempts outside of this range are considered illegal guesses. **Sample Game Run:** - **Computer:** OK, I am thinking of a number. Try to guess it. - **Player's Guess:** 50 - **Feedback:** Too high! - **Player's Guess:** 112 - **Feedback:** Illegal guess. Your guess must be between 1 and 100. - **Player's Guess:** 23 - **Feedback:** **** CORRECT **** **After the Game:** - **Computer:** Want to play again? - **Player's Response:** N - **Feedback:** Good bye, it was fun. Play again soon. **Notes:** - The game is straightforward, with user input displayed in bold. - Have fun while improving your number-guessing skills!
Expert Solution
steps

Step by step

Solved in 2 steps with 1 images

Blurred answer
Knowledge Booster
Types of Loop
Learn more about
Need a deep-dive on the concept behind this application? Look no further. Learn more about this topic, computer-science and related others by exploring similar questions and additional content below.
Similar questions
  • SEE MORE QUESTIONS
Recommended textbooks for you
Database System Concepts
Database System Concepts
Computer Science
ISBN:
9780078022159
Author:
Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Publisher:
McGraw-Hill Education
Starting Out with Python (4th Edition)
Starting Out with Python (4th Edition)
Computer Science
ISBN:
9780134444321
Author:
Tony Gaddis
Publisher:
PEARSON
Digital Fundamentals (11th Edition)
Digital Fundamentals (11th Edition)
Computer Science
ISBN:
9780132737968
Author:
Thomas L. Floyd
Publisher:
PEARSON
C How to Program (8th Edition)
C How to Program (8th Edition)
Computer Science
ISBN:
9780133976892
Author:
Paul J. Deitel, Harvey Deitel
Publisher:
PEARSON
Database Systems: Design, Implementation, & Manag…
Database Systems: Design, Implementation, & Manag…
Computer Science
ISBN:
9781337627900
Author:
Carlos Coronel, Steven Morris
Publisher:
Cengage Learning
Programmable Logic Controllers
Programmable Logic Controllers
Computer Science
ISBN:
9780073373843
Author:
Frank D. Petruzella
Publisher:
McGraw-Hill Education