Worked solution from the Algorithm design and problem-solving Paper 2 Algorithms, Programming and Logic booklet, Part 8 of 8.
Describe the steps in order. Write three of these:
The marks input are stored in the array Score[] [1]
Each mark is checked against boundaries (70, 60, 50, 40, 30) and a matching grade is stored in the array Grade[] at the same index as the mark [1]
This is repeated until 30 marks have been input [1]
Use a loop to go through each element and output both arrays with a message.
FOR Count ← 0 TO 29
OUTPUT "Student: ", Count, " Mark: ", Score[Count], " Grade: ", Grade[Count]
NEXT CountCorrect loop (including a counter if it is not a FOR loop) [1]
Score[] and Grade[] both output correctly [1]
Suitable messages or text in the output [1]
A WHILE or REPEAT loop with its own counter also scores.
Write three of these:
Add an input so the teacher can enter the class size [1]
Store it in a variable and use it as the end condition of the loop (UNTIL Count = ClassSize) [1]
Make sure the arrays are big enough for the largest class [1]
▶ Topic lesson
A lesson on this topic · by Mr Bulmer's Learning Zone. Tap the picture to open it on YouTube.
Solutions follow the official Cambridge mark schemes; marks are shown in grey. Videos are from other YouTube channels. Paper codes read component / series / year: M/J = May/June, O/N = October/November. Past-paper questions © UCLES, reproduced for classroom practice.