Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

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.

image text in transcribed

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

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

How To Make A Database In Historical Studies

Authors: Tiago Luis Gil

1st Edition

3030782409, 978-3030782405

More Books

Students also viewed these Databases questions

Question

Do you think physicians should have unions? Why or why not?

Answered: 1 week ago