2210/21/M/J/25 question 3: worked solution (May/June 2025, paper 21)

Show as plain text

Cambridge O Level Computer Science 2210 · 8.1 Programming concepts Worked solution from the Programming Paper 2 Algorithms, Programming and Logic booklet, Part 1 of 3. Q34 2210/21/M/J/25 original Q3 Structured · 4 marks Worked solution Condition-controlled loop Use REPEAT ... UNTIL (or WHILE) with your own counter. Count ← 1 REPEAT OUTPUT "Please enter a name" INPUT Name Names[Count] ← Name Count ← Count + 1 UNTIL Count > 10 Count set to 1 before the loop [1] A condition-controlled loop (REPEAT ... UNTIL or WHILE ... ENDWHILE) that runs 10 times, with its end keyword [1] Count increased by 1 inside the loop [1] Rest of the algorithm (OUTPUT, INPUT, store in Names[Count]) correct [1] A WHILE Count <= 10 DO ... ENDWHILE loop is also accepted. KEY IDEA A condition loop needs its own counter set up before and updated inside. TOTAL 4 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.