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

Section B 2 (a) Write an algorithm in pseudocode to input 500 positive whole numbers. Each number input must be less than 1000. Find and output the largest number input, the smallest number input and the range (difference between the largest number and smallest number).

  1. (a)Write an algorithm in pseudocode to input 500 positive whole numbers. Each number input must be less than 1000. Find and output the largest number input, the smallest number input and the range (difference between the largest number and smallest number).[6]
  2. (b)Describe how the algorithm could be changed to make testing less time-consuming.[2]

Mark scheme

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

  1. [1] Initialisation of large and small variables e.g. Large ← 0 Small ← 1000
  2. [1] Use of a loop for 500 entries // or 499 if initialisation done on first correct entry
  3. [1] Input with prompt
  4. [1] Attempt at checking the range of 1 to 999 for input
  5. [1] ... working range check
  6. [1] Checking for a whole number
  7. [1] Selecting largest number
  8. [1] Selecting smallest number
  9. [1] Calculating the range
  10. [1] Outputting the largest, smallest and range with message
  11. [1] Reduce the amount of numbers entered
  12. [1] By decreasing the final value of the loop
  13. [1] Remove the need to input values
  14. [1] By using random numbers / a previously populated array

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