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
- (a)Describe what happens in this algorithm.[3]
- (b)Write the pseudocode to output the contents of the arrays Score[] and Grade[] along with suitable messages.[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] Marks input are stored in the array Score []
- [1] Marks are checked against a range of boundaries // allow example
- [1] and a matching grade is assigned to each mark that has been input
- [1] then stored in the array Grade []...
- [1] at the same index as the mark input
- [1] The algorithm finishes after 30 marks have been input // allows 30 scores to be entered
- [1] Correct loop, including counter if not a FOR loop
- [1] Correct output of Score []
- [1] Correct output of Grade []
- [1] Suitable messages/text in output for both arrays
- [1] Add an input facility to allow teachers to enter the class size
- [1] Add a variable to store the input class size
- [1] Use the class size variable as the terminating condition for the loop
- [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 →