Cambridge AS Level Computer Science 9618 · 9.2 Algorithms

Q14 · 9618/22/M/J/21 Q4

Worked solution from the Algorithm Design and Problem-solving Paper 2 Problem-solving and Programming booklet, Part 2 of 2.

Q149618/22/M/J/21original Q4Structured · 6 marks
Question 4 from 9618/22/M/J/21

Worked solution

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).

KEY IDEADescribe set-up, a loop with input, decision and output inside it, then the average after the loop.
TOTAL 6 marks

Official mark scheme

Mark scheme for 9618/22/M/J/21 question 4
VIDEO
▶ 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.