9618/22/M/J/21 question 4: worked solution (May/June 2021, paper 22)
Show as plain textHide plain text
Cambridge AS Level Computer Science 9618 · 9.2 Algorithms Worked solution from the Algorithm Design and Problem-solving Paper 2 Problem-solving and Programming booklet, Part 2 of 2. Q14 9618/22/M/J/21 original Q4 Structured · 6 marks 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 IDEA Describe set-up, a loop with input, decision and output inside it, then the average after the loop. TOTAL 6 marks Official mark scheme VIDEO ▶ Whole paper Video solution of the whole paper · by Papersdock. Tap the picture to open it on YouTube.