ExamBank Scot · N5 Computing Science question bank · All N5 Computing Science questions

N5 Computing Science 2014 Question 12

2 marks · Input validation

This pseudocode allows a user to enter the level they wish to start playing a game. Line 1 RECEIVE level FROM (INTEGER) KEYBOARD Line 2 WHILE level < 1 OR level > 10 DO Line 3 Line 4 SEND “error : please re-enter level” TO DISPLAY RECEIVE level FROM (INTEGER) KEYBOARD Line 5 END WHILE Explain what happens if a user enters 12.

Marking scheme

An error is displayed (1 mark for exemplifying line 3) User re-enters a level (1 mark for exemplifying line 4)

Previous question: N5 Computing Science 2014 Question 11

Next question: N5 Computing Science 2014 Question 13