Database System Concepts
Database System Concepts
7th Edition
ISBN: 9780078022159
Author: Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Publisher: McGraw-Hill Education
Bartleby Related Questions Icon

Related questions

bartleby

Concept explainers

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!
expand button
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
Check Mark
Knowledge Booster
Background pattern image
Computer Science
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
Text book image
Database System Concepts
Computer Science
ISBN:9780078022159
Author:Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Publisher:McGraw-Hill Education
Text book image
Starting Out with Python (4th Edition)
Computer Science
ISBN:9780134444321
Author:Tony Gaddis
Publisher:PEARSON
Text book image
Digital Fundamentals (11th Edition)
Computer Science
ISBN:9780132737968
Author:Thomas L. Floyd
Publisher:PEARSON
Text book image
C How to Program (8th Edition)
Computer Science
ISBN:9780133976892
Author:Paul J. Deitel, Harvey Deitel
Publisher:PEARSON
Text book image
Database Systems: Design, Implementation, & Manag...
Computer Science
ISBN:9781337627900
Author:Carlos Coronel, Steven Morris
Publisher:Cengage Learning
Text book image
Programmable Logic Controllers
Computer Science
ISBN:9780073373843
Author:Frank D. Petruzella
Publisher:McGraw-Hill Education