Computer Science · May / June 2026 · Paper 22 · Question 3
0478
As printed in the paper
Show the answer and mark scheme
3(a)(i)[1]
Presence (check)
3(a)(ii)[1]
Check digit
3(b)[3]
One mark each
To check that the input matches a specified / required style / pattern / structure… by containing set numbers of letters and numbers // … by containing specified groups of digits // … by containing specific characters within the textAn example of a format e.g. date format dd/mm/yyyy3(c)[6]
One mark each
Appropriate loop to iterate for 15 inputsInput of a numberTest if the input is an integer e.g. use of MOD, DIV or ROUND functionsRepeated re-input if number not an integer, until it is an integerStore integer in the correct array locationAt least two outputs seen, from input prompt / error message / completion message.For example:
FOR Counter ← 1 TO 15
REPEAT
OUTPUT "Input a whole number"
INPUT Value
IF MOD(Value,1) <> 0
// IF ROUND(Value,0) <> Value
// IF DIV(Value,1) <> Value
THEN
OUTPUT "Your number was not an integer, please re- input"
ELSE
Accepted[Counter] ← Value ENDIF
UNTIL MOD(Value, 1) = 0
NEXT Counter
OUTPUT "The check has been completed"
Make a free account to save your answers and see your weak topics and ask the AI why a wrong answer is wrong.

