Puzzle 3 – Linear Search Algorithm

Step 4 – keep track of guesses

The final thing to do is keep track of the number of guesses needed.

  1. set up a variable called  guesses at the top of the program with the value 0
  2. inside the  while loop, add a line of code to add one to  guesses
  3. after the  while loop tell the user how many guesses they took

There's a way to add one to a variable which is really important...

Think about what else you could add to your program...