Worked solution from the Algorithm Design and Problem-solving Paper 2 Problem-solving and Programming booklet, Part 2 of 2.
Describe the algorithm in order, in words, as steps:
Set the Total of marks to 0 and the Count of students to 0 before the loop [1]
Repeat for every student in the class (a loop that runs once for each student) [1]
Inside the loop, input the student's mark [1]
Compare the mark with the grade boundaries (for example 80 or more is A) to decide the grade [1]
Output the grade for that student [1]
Add the mark to the Total (and add 1 to the Count if it is being counted) [1]
After the loop, divide Total by Count to get the average mark and output it (this seventh point is extra: only 6 marks are given).
▶ Whole paper
Video solution of the whole paper · by Papersdock. 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.