Question: Your program will ask the user if they want to play a game only allowing the answers 'y' or 'n' (or capitalized versions). Should the

Your program will ask the user if they want to play a game only allowing the answers 'y' or 'n' (or capitalized versions). Should the user enter an invalid answer keep asking them until they do. When the user wants to play a game ask them to guess a random number that you generated between 0 and 9 inclusive. You will let them guess as many times as it takes for them to guess the correct number (let them know if they're correct or if they should guess higher or lower) or they enter 'x' (or 'X') to stop guessing. Should they decide to end the game let them know what the correct number was. When they enter something that is not a digit or an 'x' simply ignore that input and let them keep guessing. Once the game is over ask them if they want to play again.

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!