2210/23/O/N/25 question 5: worked solution (October/November 2025, paper 23)

Show as plain text

Cambridge O Level Computer Science 2210 · 7.7 Trace tables Worked solution from the Algorithm design and problem-solving Paper 2 Algorithms, Programming and Logic booklet, Part 6 of 8. Q65 2210/23/O/N/25 original Q5 Structured · 6 marks Worked solution (a) Run the loop for each number. Lowest starts at 900 and Highest at 1. Count Number Lowest Highest 900 1 1 563 563 1 2 21 21 1 3 376 21 376 4 99 21 376 5 400 21 400 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 IDEA Nested 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 VIDEO ▶ Topic lesson A lesson on this topic · by Mr Bulmer's Learning Zone. Tap the picture to open it on YouTube.