Skip to main content
O-LevelComputer ScienceProgramming2210/21 · May/June 2020 · Q48 Marks

The pseudocode algorithm shown should allow numbers to be entered and should allow 50 numbers to be stored in an array. ``` Count ← 0 REPEAT INPUT Values [Count] Count← Count + 1 UNTIL Count = 0 ```

  1. (a)Explain why the algorithm will never end.[2]
  2. (b)Re-write the original pseudocode so that it terminates correctly and also prevents numbers below 100 from being stored in the array Values[ ][4]
  3. (c)Describe how you could change your pseudocode in part (b) so that it prevents numbers below 100 and above 200 from being stored in the array Values[ ][2]

Mark scheme

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

  1. [2] Any two correct statements (max two) e.g. The value of the variable Count begins as 0, and is incremented by 1 before it is tested by the loop condition, Count will never be 0 at the end of the loop
  2. [4] Count ← 0 REPEAT INPUT Number IF Number >= 100 THEN Values[Count] ← Number ENDIF Count ← Count + 1 UNTIL Count = 50
  3. One mark - separate INPUT statement
  4. One mark - IF statement attempted
  5. One mark - IF statement completely correct
  6. One mark - termination of loop updated
  7. [2] Any two correct statements (max two) e.g. Alter the IFstatement/add a second IF statement/comparison that's already there ..., so that additional criteria set an upper limit of <=200

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, 8 marks.
Source
O-Level Computer Science, May/June 2020 Paper 2 Variant 1, 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