Question: 6. Guess the Number Game Write a program that allows a user to play the guessing game. Select the range of valid numbers - (i.e.

 6. Guess the Number Game Write a program that allows a

6. Guess the Number Game Write a program that allows a user to play the guessing game. Select the range of valid numbers - (i.e. guess a number from 1 -20). Generate a random number within this range as the answer. Hint: print the answer so you know it for your testing. Continue playing (aka looping) until they guess the correct answer. Prompt the user for a guess. If their number is higher than the answer, display a message letting them know the correct answer is lower. If their guess is too low, display a message. Include range validation for their guess. You'll need a counter variable to keep track of the tries needed to guess the correct number. When the user matches the answer, display a congratulations message and let them know how many tries it took

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!