The computer picks a number between one and a hundred and Itry to find it. Tell me higher or lower each time. When I getit, tell me how many guesses it took.Write your requirements list before you write any code. Input, calculate, output, and anything you had to decide for yourself.
This is the biggest program in this set. It is three stars because it needs a loop, a decision inside that loop, a random number, and a count that survives the whole thing — four ideas at once, all of which you already have.
while loop and not a fixed number of repeats.turn counter in Activity 1.17 did exactly this job.Random.Shared.Next(1, 101) gives 1 through 100. The second number is where it stops — Activity 1.16 if you need it again.I'm thinking of a number between 1 and 100.
Your guess: 50 [Enter]Higher.Your guess: 75 [Enter]Lower.Your guess: 62 [Enter]Got it! That took 3 guesses.Play it until you have seen higher, lower, and a first-try win. The first-try win is the one that will be wrong, and it is the one you are least likely to hit by accident.
Your requirements list and your program file, named cc-guessing-game.