Cambridge O Level Computer Science 2210 · 7.7 Trace tables

Q65 · 2210/23/O/N/25 Q5

Worked solution from the Algorithm design and problem-solving Paper 2 Algorithms, Programming and Logic booklet, Part 6 of 8.

Q652210/23/O/N/25original Q5Structured · 6 marks
Question 5 from 2210/23/O/N/25

Worked solution

(a)

Run the loop for each number. Lowest starts at 900 and Highest at 1.

CountNumberLowestHighest
9001
15635631
221211
337621376
49921376
540021400

Count column correct [1]

Number column correct [1]

Lowest column correct [1]

Highest column correct [1]

(b)

Reason: the ELSE means Highest is only checked when the number is not a new lowest, so Highest is wrong (the first number, 563, becomes the Lowest and Highest stays 1). [1]

Correction: replace ELSE on line 08 with ENDIF and remove the ENDIF on line 13, so there are two separate IF statements, one for Lowest and one for Highest. [1]

KEY IDEANested IF ... ELSE stops the second test from running when the first is true, so two independent checks need two separate IF statements.
TOTAL 6 marks

Official mark scheme

Mark scheme for 2210/23/O/N/25 question 5
VIDEO
▶ Topic lesson

A lesson on this topic · by Mr Bulmer's Learning Zone. Tap the picture to open it on YouTube.

Solutions follow the official Cambridge mark schemes; marks are shown in grey. Videos are from other YouTube channels. Paper codes read component / series / year: M/J = May/June, O/N = October/November. Past-paper questions © UCLES, reproduced for classroom practice.