Worked solution from the Software Development Paper 2 Problem-solving and Programming booklet, Part 3 of 3.
Find the three wrong operators and write the correction:
Num > Min should be Num < Min (to find the smallest) [1]
Count & 1 should be Count + 1 (add, not join) [1]
UNTIL NextInput ← "END" should be UNTIL NextInput = "END" (compare, not assign) [1]
Min starts at 999, so a number is only stored if it is below 999.
The problem is when all the numbers input are greater than 999, or there are no numbers at all [1]
Then the output minimum is wrongly 999 and not one of the input values [1]
Use a mix of words and numbers where every number is bigger than 999, ending with END.
Write for example: 1325, DOG, 7868, END
A mixture of numeric and non-numeric values with all the numbers greater than 999 [1]
The last value is END [1]
▶ Starts at Q5 (28:29)
Starts at Q5 (28:29) · 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.