Cambridge O Level Computer Science 2210 · 8.1 Programming concepts

Q32 · 2210/22/M/J/24 Q7

Worked solution from the Programming Paper 2 Algorithms, Programming and Logic booklet, Part 1 of 3.

Q322210/22/M/J/24original Q7Structured · 6 marks
Question 7 from 2210/22/M/J/24

Worked solution

(a)

Assignment uses ←, selection is the IF, iteration is the FOR loop.

Assignment statement: any of 01, 02, 06 or 10 [1]

Selection statement: 04 (or 08, or 04 to 07) [1]

Iteration statement: 03 (or 12, or 03 to 12) [1]

(b)

Check each line against what the algorithm should do. Write any three of these (line number and correction):

Line 04: < should be > (to find the maximum) [1]

Line 08: Count should be Counter [1]

Line 11: ENDWHILE should be ENDIF [1]

KEY IDEATest each IF against its purpose, match each variable name, and close every structure with its own end keyword.
TOTAL 6 marks

Official mark scheme

Mark scheme for 2210/22/M/J/24 question 7
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.