Question: Question Goal: Learn how to use sentinels in while loops to control when to exit. Assignment: A quite different way of using sentinels is to
Question
Goal: Learn how to use sentinels in while loops to control when to exit.
Assignment: A quite different way of using sentinels is to write guessing games. The sentinel becomes the value you need to guess. The game should keep going until the user guesses the right value.
lower than rightvalue. At the end, the program should display the number of guesses the player made.
Note: Take a look at the sample run. Make sure your program's prompts and messages are the same.
Sample Run User input enclosed in
Enter a guess:
Your guess is too low.
Enter a guess:
Your guess is too high.
Enter a guess:
Your guess is too low.
Enter a guess:
Correct! It took you guesses.
Your guess ; is too low.
Entera guess:
Step by Step Solution
There are 3 Steps involved in it
1 Expert Approved Answer
Step: 1 Unlock
Question Has Been Solved by an Expert!
Get step-by-step solutions from verified subject matter experts
Step: 2 Unlock
Step: 3 Unlock
