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

An algorithm has been written in pseudocode to find and display the maximum and minimum values in an array of 1000 positive numbers. The array List[] starts at index 1 01 Max← List[1] 02 Min← List[1] 03 FOR Counter ← 2 TO 1000 04 IF List[Counter] < Max 05 THEN 06 Max ← List[Counter] 07 ENDIF 08 IF List[Count) < Min 09 THEN 10 Min ← List[Counter] 11 ENDWHILE 12 NEXT Counter 13 OUTPUT "Maximum value is ", Max 14 OUTPUT "Minimum value is ", Min

  1. (a)Give a line number for each of these types of statement: Assignment statement Selection statement Iteration statement[3]
  2. (b)Identify the line numbers of the three errors in the pseudocode and suggest a correction for each error.[3]

Mark scheme

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

  1. 01//02//06//10
  2. 04(07) and/or 08
  3. 03(12)
  4. One mark for each error identified and corrected
  5. Line 04 < should be >
  6. Line 08 Count should be Counter
  7. Line 11 ENDWHILE should be ENDIF
  8. 01 Max← List[1]
  9. 02 Min← List[1]
  10. 03 FOR Counter ← 2 TO 1000
  11. 04 IF List[Counter] > Max
  12. 05 THEN
  13. 06 Max ← List[Counter]
  14. 07 ENDIF
  15. 08 IF List[Counter] < Min
  16. 09 THEN
  17. 10 Min ← List[Counter]
  18. 11 ENDIF
  19. 12 NEXT Counter
  20. 13 OUTPUT "Maximum value is ", Max
  21. 14 OUTPUT "Minimum value is ", Min

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

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