-
Notifications
You must be signed in to change notification settings - Fork 0
Home
PMARINA edited this page Jan 29, 2017
·
2 revisions
Implement this program to play the game of “guess the number” as follows:
I have a number between 1 and 100. Can you guess my number? Please type your first guess.
Followed by one of following responses:
- Excellent! You guessed the number! You guessed in 4 tries. Would you like to play again (y/n)?
- Too low. Try again.
- Too high. Try again.
If the player’s is incorrect, your program should loop until the player finally gets 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. After a game ends, the program should report the number of games the player played and prompt the user to enter “y” to play again or “n” to exit the game.