Skip to main content
A-LevelComputer ScienceAlgorithm design and problem-solving9618/22 · Oct/Nov 2022 · Q47 Marks

4 The program flowchart represents a simple algorithm.

  1. (a)Write the equivalent pseudocode for the algorithm represented by the flowchart.[6]
  2. (b)Give the name of the iterative construct in the flowchart.[1]

This question uses a diagram from the original paper, which isn't shown here. Open the full paper from the past papers archive to see it.

Mark scheme

Marking points from the official mark scheme (Oct/Nov 2022). The mark or mark type is shown in brackets.

  1. [6] (a) One mark per point: 1 Input UserID and use of GetAverage() and assignment 2 Initialisation of Total to zero and Index to 4 3 Conditional loop with Index from 4 to 6 4 Assignment of Last from element SameMonth[Index] in a loop 5 Structure: IF...THEN...ELSE...ENDIF in a loop 6 Correct assignments and final call to Update () after the loop INPUT UserID Average <- GetAverage(UserID) Total <- 0 Index <- 4 WHILE Index < 7 // REPEAT Index <- Index + 1 Last <- SameMonth[Index] IF Average > Last THEN Total <- Total + Average ELSE Total <- Total + Last ENDIF ENDWHILE // UNTIL Index = 7 CALL Update(UserID, Total) Alternative solution using FOR loop: One mark per point FOR loop solution: 1 Input UserID and use of GetAverage() and assignment 2 Initialisation of Total to zero 3 loop Index from 4 to 6 4 Assignment of Last from array SameMonth in a loop 5 Comparison IF...THEN...ELSE...ENDIF in a loop 6 Appropriate assignments in a loop AND final call to Update () after the loop INPUT UserID Average <- GetAverage (UserID) Total <- 0 FOR Index <- 4 TO 6 Last <- SameMonth [Index] IF Average > Last THEN Total <- Total + Average ELSE Total <- Total + Last ENDIF NEXT Index CALL Update (UserID, Total)
  2. [1] (b) Pre-condition (loop) / count-controlled (loop)

Write your answer and get it marked

On Oracle Prep you can write or photograph your own answer and have it marked by AI against this mark scheme, with feedback on what you missed.

Sign up free →

About this question

Topic
Algorithm design and problem-solving, A-Level Computer Science (syllabus 9618). Structured question, 7 marks.
Source
A-Level Computer Science, Oct/Nov 2022 Paper 2 Variant 2, question 4.

Questions and mark schemes are from past examination papers and remain the copyright of the exam board. How Oracle Prep builds its content

Related Computer Science questions

© 2026 Oracle Prep