Computer Science · May / June 2021 · Paper 21 · Question 4
0478
As printed in the paper
The question as text
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
Read automatically from the paper; the printed page above is exact.
Show the answer and mark scheme
4(a)[3]
One mark per mark point (Max 3)
MP1
Marks input are stored in the array Score[]
MP2
Marks are checked against a range of boundaries // allow example
MP3
… and a matching grade is assigned to each mark that has been input
MP4
… then stored in the array Grade[]…
MP5
… at the same index as the mark input
MP6
The algorithm finishes after 30 marks have been input // allows 30 scores to be entered
4(b)[3]
One mark per mark point (Max 3)
MP1
Correct loop, including counter if not a FOR loop
MP2
Correct output of Score[]
MP3
Correct output of Grade[]
MP4
Suitable messages/text in output for both arrays
Example answers
Count ← 0
REPEAT
PRINT "Student: ", Count, " Mark: ", Score[Count], " Grade: ",Grade[Count]
Count ← Count + 1
UNTIL Count = 30
Count ← 0
WHILE Count < 30 DO
PRINT "Student: ", Count, " Mark: ", Score[Count], " Grade: ",Grade[Count]
Count ← Count + 1
ENDWHILE
FOR Count ← 0 TO 29
PRINT "Student: ", Count, " Mark: ", Score[Count], " Grade: ", Grade[Count]
NEXT
4(c)[3]
Any three correct statements (Max 3) e.g.
MP1 Add an input facility to allow teachers to enter the class size
MP2 Add a variable to store the input class size
MP3 Use the class size variable as the terminating condition for the loop
MP4 Make sure the arrays are sufficiently large to accommodate the largest possible class size
Make a free account to save your answers and see your weak topics and ask the AI why a wrong answer is wrong.

