• The program asks the user for the maximum value a number could be, as well as the maximum amount of allowed guesses. •

Business, Finance, Economics, Accounting, Operations Management, Computer Science, Electrical Engineering, Mechanical Engineering, Civil Engineering, Chemical Engineering, Algebra, Precalculus, Statistics and Probabilty, Advanced Math, Physics, Chemistry, Biology, Nursing, Psychology, Certifications, Tests, Prep, and more.
Post Reply
answerhappygod
Site Admin
Posts: 899604
Joined: Mon Aug 02, 2021 8:13 am

• The program asks the user for the maximum value a number could be, as well as the maximum amount of allowed guesses. •

Post by answerhappygod »

The Program Asks The User For The Maximum Value A Number Could Be As Well As The Maximum Amount Of Allowed Guesses 1
The Program Asks The User For The Maximum Value A Number Could Be As Well As The Maximum Amount Of Allowed Guesses 1 (55.97 KiB) Viewed 64 times
The Program Asks The User For The Maximum Value A Number Could Be As Well As The Maximum Amount Of Allowed Guesses 2
The Program Asks The User For The Maximum Value A Number Could Be As Well As The Maximum Amount Of Allowed Guesses 2 (52.28 KiB) Viewed 64 times
The Program Asks The User For The Maximum Value A Number Could Be As Well As The Maximum Amount Of Allowed Guesses 3
The Program Asks The User For The Maximum Value A Number Could Be As Well As The Maximum Amount Of Allowed Guesses 3 (34.64 KiB) Viewed 64 times
• The program asks the user for the maximum value a number could be, as well as the maximum amount of allowed guesses. • The program randomly chooses an integer between 0 and the maximum number. • The user then has only the max amount of guesses to figure out what number was selected. • The user enters a guess. • After each guess, the program tells the user whether their guess is too high, or too low. • The user keeps guessing until they get the correct number, or they've reached the maxmum amount of allowed guesses. Here is an example run of what the program output and interaction should be:

Input seed for random (leave blank for none): . Welcome to the number guessing game! What is the maximum value the number could be? 100 What is the maximum number of guesses allowed? 5 OK! I've thought of a number between 0 and 100 and you must guess it. For each guess, I'll tell you if you're too high or too low. Number of guesses left: 5 Enter your guess: 50 Too low! L2 Number of guesses left: 4 Enter your guess: 75 Too high! Number of guesses left: 3 Enter your guess: 60 Too high! Number of guesses left: 2 Enter your guess: 55 Too low! =

Number of guesses left: 3 Enter your guess: 60 Too high! Number of guesses left: 2 Enter your guess: 55 Too low! Number of guesses left: 1 Enter your guess: 57 Too low! Boo! You didn't guess it. The number was 59
Join a community of subject matter experts. Register for FREE to view solutions, replies, and use search function. Request answer by replying!
Post Reply