Skip to content

Dr. Ada Owens

inIntro to CS1h

Build the game from the spec sheet. It should loop until the player wins and tell them higher or lower each turn.

Pick a random number between 1 and 100, then read a guess and respond with higher, lower, or correct. Keep going until they get it. That is the whole program, and it is more than enough for a first project.

Name your variables so I can read the loop without asking you what it does. Ten marks of the thirty are for a program somebody else can follow.

AssignmentDue Wed 11 Mar · 30 points
11
Comment3

3 Comments

  • Mei LinStudent55m

    My loop runs forever when the player types a letter. Is input validation part of the spec?

    6

  • Dr. Ada OwensComputer Science35m

    Not required, but handle it anyway. A program that survives a typo is worth the extra six lines.

    18

  • Ivan PetrovStudent10m

    Turned mine in. Printing the guess count at the end made testing far easier.

    4