question archive Guessing Game Programming is an important subset of computer science
Subject:Computer SciencePrice: Bought3
Guessing Game
Programming is an important subset of computer science. There are many different
high-level languages that have been created to make programming computers less
difficult, each with its own pros and cons. This assignment will give you practice with
learning the basics of your chosen programming language.
Make a guessing game with a twist. You will play the
role of the computer, and the computer will try to guess the number. You will think of a
number (you don't have to read it in as input) between 1 and 100. A
loop will be created that runs 5 times. In this loop, the computer will try to guess the number in the
range it knows is valid (to start, the range will be 1-100) and will print out the guess on
the screen. Next, it will ask you if you its guess is correct. You will respond with "High",
"Low", or "Correct". If it is not correct, the computer will adjust its range and loop
around to guess again. If it is correct, the computer will print out a happy message and
exit. If the computer has not guessed correctly after 5 tries, it will print out a sad
message and exit.
Sample Output (User-Typed Information Is Bolded/Underlined):
Time to play Guessing Game!
I think the number is 27.
How'd I do? Low
I think the number is 92.
How'd I do? High
I think the number is 58.
How'd I do? Correct
Yes! I won!
Now it is time to write a program in the language of your choice to implement the backwards guessing
game.