Worked solution from the Algorithm Design and Problem-solving Paper 2 Problem-solving and Programming booklet, Part 2 of 2.
Write five short steps in plain words, in the right order. Do not use pseudocode.
Step 1: set the total to zero [1]
Step 2: input a number [1]
Step 3: check whether the number is between 30 and 70 inclusive (greater than 29 and less than 71) [1]
Step 4: if it is, add the number to the total [1]
Step 5: repeat steps 2 to 4 until 100 numbers have been input, then output the total [1]
Another way to score: give the repeat step and the output step as two separate steps (any five of the points earn the marks).
Name the two constructs besides sequence.
Iteration (a count-controlled loop) [1]
Selection (an IF statement) [1]
▶ Starts at Q2 (9:40)
Starts at Q2 (9:40) · 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.