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

An algorithm has been written in pseudocode to input the names and marks of 35 students. The algorithm stores the names and marks in two arrays Name [ ] and Mark []. The highest mark awarded is found and the number of students with that mark is counted. Both of these values are output. 01 HighestMark ← 100 02 HighestMarkStudents ← 0 03 FOR Count ← 1 ΤΟ 35 04 OUTPUT "Please enter student name" 05 INPUT Name [Count] 06 OUTPUT "Please enter student mark" 07 INPUT Mark [Counter] 08 IF Mark [Count] = HighestMark 09 THEN 10 HighestMarkStudents ← HighestMarkStudents 1 11 ENDIF 12 IF Mark [Count] > HighestMark 13 THEN 14 Mark [Count] ← HighestMark 15 HighestMarkStudents ← 1 16 ENDIF 17 NEXT Count 18 OUTPUT "There are ", HighestMarkStudents," with the highest mark of ", HighestMark

  1. (a)Give line numbers where the four errors are to be found in the pseudocode. Suggest a correction for each error. Error 1 line number Correction Error 2 line number Correction Error 3 line number Correction Error 4 line number Correction[4]
  2. (b)Explain how you could extend the algorithm to also find the lowest mark awarded, count the number of students with that mark, and output both these values.[6]

Mark scheme

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

  1. [1] Line 1 error: HighestMark ← 100; Correction: HighestMark ← 0
  2. [1] Line 7 error: INPUT Mark [Counter]; Correction: INPUT Mark [Count]
  3. [1] Line 10 error: HighestMarkStudents ← HighestMarkStudents 1; Correction: HighestMarkStudents ← HighestMarkStudents + 1
  4. [1] Line 14 error: Mark [Count] ← HighestMark; Correction: HighestMark ← Mark[Count]
  5. [1] Add variable LowestMark
  6. [1] Set LowestMark to a high value (e.g., 100)
  7. [1] Add variable LowestMarkStudents
  8. [1] Set LowestMarkStudents to zero
  9. [1] Check if Mark [Count] = LowestMark
  10. [1] If true, add 1 to LowestMarkStudents
  11. [1] Check if Mark [Count] < LowestMark
  12. [1] If true, set LowestMarkStudents to 1 and set LowestMark to Mark [Count]
  13. [1] Add extra output statement for lowest mark and 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, 10 marks.
Source
O-Level Computer Science, May/June 2020 Paper 2 Variant 2, question 3.

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