Question: Description: You are going to write a guessing number game. You will generate a random number between 1 and 200. You will ask the user
Description: You are going to write a guessing number game. You will generate a random number between 1 and 200. You will ask the user to guess the number. If the number is correct, you will display You guessed it and the number of guesses. If their guess is too low, you will display Too low and if their guess is too high, you will display Too high. In your program, you need to keep track of the number of guesses so you can display it when they get it correct. After the user guesses the answer, you will ask them if they want to continue and have them enter y to continue or anything else to end.
#include

Description: You are going to write a guessing number game. You will generate a random number between 1 and 200. You will ask the user to guess the number. If the number is correct, you will display "You guessed it" and the number of guesses. If their guess is too low, you will display "Too low and if their guess is too high, you will display "Too high". In your program, you need to keep track of the number of guesses so you can display it when they get it correct. After the user guesses the answer, you will ask them if they want to continue and have them enter 'y to continue or anything else to end. Sample output: Guess number between 1 and 200. (Assume the number is 77 for this example.) Enter number: 101 Too high Enter number: 70 Too low Enter number: 77 You guessed it Number of guesses: 3 Enter 'y' to continue
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
