Skip to main content
O-LevelComputer ScienceProgramming2210/21 · May/June 2015 · Q24 Marks

Read this section of program code that should input 10 positive numbers and then output the smallest number input. 1 Small = 0 2 Counter = 0 3 REPEAT 4 INPUT Num 5 IF Num < Small THEN Num = Small 6 Counter = Counter + 1 7 PRINT Small 8 UNTIL Counter < 10 There are four errors in this code. Locate these errors and suggest a corrected piece of code for each error.

Mark scheme

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

  1. [1] 1 mark for each error identified + suggested correction Line 1 or Small = 0: this should read Small = 999
  2. [1] line 5 or IF...: this should read IF Num < Small THEN Small = Num
  3. [1] line 8 or UNTIL: this should read UNTIL Counter = 10 or UNTIL Counter > = 10 or UNTIL Counter > 9
  4. [1] line 7 or PRINT...: PRINT Small should come after the end of the repeat loop or line 8 or UNTIL: this should come before line 7

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