Answered step by step
Verified Expert Solution
Question
1 Approved Answer
Final Exam Part I ( 3 0 exam points ) Write a complete program to let the user play a guess a number between 1
Final Exam Part I exam points
Write a complete program to let the user play a "guess a number between and guessing game with the computer. If the user does not guess correctly
then the computer will update the boundaries using the last guess as one of the new boundaries.
When the user finally guesses the number, the computer should acknowledge this and also display the number of valid guesses that the user made. When the
user finally chooses not to play anymore, the program should print out a message with the best round played.
Below you will find an example run. Note that you must print out the correct answer each time before the user starts making guesses, so that I can verify
that the program is correctly winnowing down the search space. Failure to do so results in zero "functions correctly" points, and is guaranteed to drag some not
insignificant number of design points with it
Finally, this is officially part of your final exam. This is individual effortno help from anyone beyond the course instructors and lab assistants. We will
answer clarifying questions, point to the general location of errors, etc, but little else.
Welcome to the Guessing Game!
answer is
Guess a number between and :
Too low!
Guess a number between and :
Your guess must be between and
Guess a number between and : Bob
Your guess must be a number.
Guess a number between and :
Too low!
Guess a number between and :
Too high!
Guess a number between and :
Too low!
Guess a number between and :
You guessed it
It only took you guesses.
Play again? YN:
answer is
Guess a number between and :
Too high!
Guess a number between and :
Too low!
Guess a number between and :
You guessed it
It only took you guesses.
Play again?
Thanks for playing!
Your best round was guesses.
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