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

The pseudocode algorithm shown has been written by a teacher to enter marks for the students in her class and then to apply some simple processing. Count ← 0 REPEAT INPUT Score[Count] IF Score[Count] >= 70 THEN Grade[Count] ← "A" ELSE IF Score[Count] >= 60 THEN Grade[Count] ← "B" ELSE IF Score[Count] >= 50 THEN Grade[Count] ← "C" ELSE IF Score[Count] >= 40 THEN Grade[Count] ← "D" ELSE IF Score[Count] >= 30 THEN Grade[Count] ← "E" ELSE Grade[Count] ← "F" ENDIF ENDIF ENDIF ENDIF ENDIF Count ← Count + 1 UNTIL Count = 30

  1. (a)Describe what happens in this algorithm.[3]
  2. (b)Write the pseudocode to output the contents of the arrays Score[] and Grade[] along with suitable messages.[3]
  3. (c)Describe how you could change the algorithm to allow teachers to use it with any size of class.[3]

Mark scheme

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

  1. [1] Marks input are stored in the array Score []
  2. [1] Marks are checked against a range of boundaries // allow example
  3. [1] and a matching grade is assigned to each mark that has been input
  4. [1] then stored in the array Grade []...
  5. [1] at the same index as the mark input
  6. [1] The algorithm finishes after 30 marks have been input // allows 30 scores to be entered
  7. [1] Correct loop, including counter if not a FOR loop
  8. [1] Correct output of Score []
  9. [1] Correct output of Grade []
  10. [1] Suitable messages/text in output for both arrays
  11. [1] Add an input facility to allow teachers to enter the class size
  12. [1] Add a variable to store the input class size
  13. [1] Use the class size variable as the terminating condition for the loop
  14. [1] Make sure the arrays are sufficiently large to accommodate the largest possible class size

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