Skip to main content
A-LevelComputer ScienceAlgorithm design and problem-solving9618/21 · May/June 2024 · Q27 Marks

An algorithm has three steps. It will: 1. repeatedly input a pair of numeric values A and B 2. count the number of pairs that are input until A has been greater than B 10 times 3. output the number of pairs that were input.

  1. (a)Complete the program flowchart.[5]
  2. (b)Step 1 of the algorithm is changed. A variable ThisSequence is used to enter a sequence of 10 pairs of numeric values, using a single input statement. Following the input of ThisSequence the revised algorithm will extract the pairs of numbers. Describe the variable ThisSequence and how the numbers are extracted.[2]

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 (May/June 2024). The mark or mark type is shown in brackets.

  1. [5] One mark per outlined region:
  2. 1 Initialise both counts
  3. 2 Increment Tries every time a pair is input
  4. 3 Compare A > B and increment Count if TRUE
  5. 4 Test for Count = 10 (10th time A > B) – MUST include Yes / No labels
  6. 5 If so output Tries, otherwise loop
  7. [2] One mark per point:
  8. 1 A (variable of type) string will be input // by example e.g. “67,72”
  9. 2 A special / identified character would need to be used to separate each numeric value // all numbers are fixed length

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, May/June 2024 Paper 2 Variant 1, question 2.

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