Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Write a program that plays the game of guess the number. -- This is for C++ - Your program chooses the number to be guessed

Write a program that plays the game of "guess the number." -- This is for C++

- Your program chooses the number to be guessed by selecting an integer at random in the range 1-1000.

-The program then displays the following: I have a number between 1 and 1000. You have 10 guesses to guess my number. Please type your first guess.

- For each guess entered, the program responds with one of the following:

1. Excellent! You guessed the number in [ x ] guesses! Would you like to play again (y or n)?

2. Too low. Try again.

3. Too high. Try again.

4. Sorry, you had your 10 guesses. The number was [ x ]. Would you like to play again (y or n)?

- If the player's guess is incorrect, your program should loop until the player finally guesses the correct number or exceeds the number of guesses allowed (10).

- Your program should keep telling the player "Too low" or "Too high" to help the player "zero in" on the correct answer.

The code needs to be divided into a header, implementation, and main file.

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

DB2 9 For Linux UNIX And Windows Advanced Database Administration Certification Certification Study Guide

Authors: Roger E. Sanders, Dwaine R Snow

1st Edition

1583470808, 978-1583470800

More Books

Students also viewed these Databases questions

Question

Subtract the following binary numbers: 1 1 1 1 and 1 0 1 0

Answered: 1 week ago