Worked solution from the Algorithm Design and Problem-solving Paper 2 Problem-solving and Programming booklet, Part 2 of 2.
Describe the steps in order, in words, not pseudocode:
Declare a variable, for example Max, to hold the largest value. [1]
Set Max to the first element of Data (any element is fine). [1]
Set up a loop that repeats 200 times (from the start to the end of the array), using the loop counter as the array index. [1]
In the loop, if the current element is greater than Max, then assign that element to Max. [1]
After the loop, output Max. [1]
Putting the loop counter as the array index, and the "greater than" test then the assignment, are each also separate points, but the most you can score is 5.
▶ Whole paper
Video solution of the whole paper · by Pseudocode Pro. 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.