Question: Write a program that prompts the user for an integer that the player (maybe the user, maybe someone else) will try to guess. If the

Write a program that prompts the user for an integer that the player (maybe the user, maybe someone else) will try to guess. If the player's guess is higher than the target number, the program should display "too high" If the user's guess is lower than the target number, the program should display "too low" The program should use a loop that repeats until the user correctly guesses the number. Then the program should print how many guesses it took. When you run your program it should match the following format:

Enter the number for the player to guess. -12 Enter your guess. 100 Too high - try again. 50 Too high - try again. -2000 Too low - try again. -12 You guessed it in 4 tries. 

The file must be named: numGuess.cpp

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!