Puzzle 3 – Linear Search Algorithm

Step 3 – compare the values

We need to compare the answer with theNumber.

We need to keep doing this so there needs to be a loop.

This is tricky, so don't worry if you can't manage all of it.

  1. set up  answer with a value of 0 first of all
  2. use a  while loop to compare  answer with  theNumber using  != for not equal to
  3. move the  input line inside the while loop
  4. use an  if–else block to tell the user if they got it right or not
  5. run your program to check if it works

This is quite tricky to get right first time...