Our site uses cookies. Some of the cookies we use are essential for parts of the site to operate and have already been set. You may delete and block all cookies from this site, but parts of the site will not work. To find out more about cookies on this website, see our Cookie Policy
Accept
© eRevision.uk and ZigZag Education 2025
This test is run by .
Note that your final mark will not be saved in the system.

Robust and Secure Programming Wipeout

Target Level
4-5
Running Total
0
0%

For this question there are 6 correct answers. For each correct answer you will score 1 mark.
Be careful, if you get one wrong you are wiped out!

Study the code snippet. Identify the test data that would be rejected and prompt the user to enter another number:

guessed ← False
target ← 11
WHILE guessed != True
   PRINT('Enter a number between 1 and 20')
   num ← STRING_TO_INT(USERINPUT)
   WHILE num <= 0 OR num > 20
      PRINT('Number out of range, try again')
      num ← USERINPUT
   ENDWHILE
   IF num = target THEN
      PRINT ('Well done, you guessed it!')
      guessed ← True
   ELSE IF num > target THEN
      PRINT('Too high')
   ELSE
      PRINT('Too low')
   ENDIF
ENDWHILE

Good luck! For each correct answer you get 1 mark.

Pass Mark
75%