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
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started