Guess-the-number-game: Write a program that pays the game of “guess the number” as follows: Your program choose the number to be guess by selecting an integer at random in the range 1 to 1000. The program then displays the following:   I have a number between 1 and 1000. Can you guess my number? Please type your first guess.   The player then type a first guess. The program responds with one of the following: 1. Excellent ! you guessed the number! Would like to play again (y or n)? 2. Too low. Try again. 3. Too high. Try again.   If the payer’s guess is incorrect, your program should loop until the player finally get the number right. Your program should keep telling the player Too high or Too low to help the player “zero in” on the correct answer.

C++ Programming: From Problem Analysis to Program Design
8th Edition
ISBN:9781337102087
Author:D. S. Malik
Publisher:D. S. Malik
Chapter5: Control Structures Ii (repetition)
Section: Chapter Questions
Problem 15PE
icon
Related questions
Question

 Guess-the-number-game: Write a program that pays the game of “guess

the number” as follows: Your program choose the number to be guess by
selecting an integer at random in the range 1 to 1000. The program then
displays the following:
 
I have a number between 1 and 1000.
Can you guess my number?
Please type your first guess.
 
The player then type a first guess. The program responds with one of the
following:
1. Excellent ! you guessed the number!
Would like to play again (y or n)?
2. Too low. Try again.
3. Too high. Try again.
 
If the payer’s guess is incorrect, your program should loop until the player
finally get the number right. Your program should keep telling the player

Too high or Too low to help the player “zero in” on the correct answer.

Expert Solution
trending now

Trending now

This is a popular solution!

steps

Step by step

Solved in 3 steps with 1 images

Blurred answer
Knowledge Booster
Mathematical functions
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
C++ Programming: From Problem Analysis to Program…
C++ Programming: From Problem Analysis to Program…
Computer Science
ISBN:
9781337102087
Author:
D. S. Malik
Publisher:
Cengage Learning
EBK JAVA PROGRAMMING
EBK JAVA PROGRAMMING
Computer Science
ISBN:
9781337671385
Author:
FARRELL
Publisher:
CENGAGE LEARNING - CONSIGNMENT
EBK JAVA PROGRAMMING
EBK JAVA PROGRAMMING
Computer Science
ISBN:
9781305480537
Author:
FARRELL
Publisher:
CENGAGE LEARNING - CONSIGNMENT