Worked solution from the Programming Paper 2 Algorithms, Programming and Logic booklet, Part 1 of 3.
Draw these four lines:
CALL Colour(NewColour) → using a procedure [1]
Value ← (A1 + A2 + A3) / 3 → finding an average [1]
Loop1 ← Loop1 + 1 → counting [1]
IF Count > 7 THEN X1 ← 0 → using a conditional statement [1]
Totalling is not needed.
Start the lowest value high, then check each of the 25 elements and keep the smaller one.
Min ← 100
FOR Count ← 1 TO 25
IF Temperatures[Count] < Min
THEN
Min ← Temperatures[Count]
ENDIF
NEXT Count
OUTPUT "The lowest temperature is ", MinLowest value set to a high value (at least 100) or the first element before the loop [1]
Loop that runs 25 times [1]
IF checks whether the element is less than the current lowest, and if so stores it as the lowest [1]
Result output once, after the loop, with a message [1]
▶ Whole paper
Video solution of the whole paper · by Paper solver.. 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.