Skip to main content
O-LevelComputer ScienceAlgorithm design and problem-solving2210/22 · May/June 2017 · Q45 Marks

An algorithm has been written in pseudocode to input 100 numbers and print out the sum. A REPEAT ... UNTIL loop has been used. `Count ← 0` `Sum ← 0` `REPEAT` `INPUT Number` `Sum ← Sum + Number` `Count ← Count + 1` `UNTIL Count > 100` `PRINT Sum`

  1. (a)Find the error in the pseudocode and suggest a correction. Error. Correction[2]
  2. (b)Rewrite the correct algorithm using a more suitable loop structure.[3]

Mark scheme

Marking points from the official mark scheme (May/June 2017). The mark or mark type is shown in brackets.

  1. [1] Error Count ← 0 // Correction Count ← 1
  2. [1] Error UNTIL Count > 100 // Correction UNTIL Count >= 100 or UNTIL Count = 100 or UNTIL Count > 99
  3. [1] use of FOR with correct start and end values
  4. [1] use of NEXT
  5. [1] removal of increment for Count

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, O-Level Computer Science (syllabus 2210). Structured question, 5 marks.
Source
O-Level Computer Science, May/June 2017 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