Worked solution from the Software Development Paper 2 Problem-solving and Programming booklet, Part 3 of 3.
Valid values are 0 to 40. Test the two edges (boundary data) and one value just outside each edge (abnormal data).
| Test | Test data value | Explanation | Expected outcome |
|---|---|---|---|
| 1 | 23 | Normal data | Data is accepted |
| 2 | 0 | Boundary data | Data is accepted |
| 3 | 40 | Boundary data | Data is accepted |
| 4 | 41 (or any value above 40) | Abnormal data | Data is rejected |
| 5 | -1 (or any value below 0) | Abnormal data | Data is rejected |
Test 2 row correct [1]
Test 3 row correct [1]
Test 4 row correct [1]
Test 5 row correct [1]
Label the four arrows:
Arrow from Heaters Off to Heaters On: Temp < 10 [1]
Arrow from Heaters On to Heaters Off: Temp > 20 [1]
Loop on each state, with a condition that is the opposite of the leaving arrow: Heaters Off loop Temp >= 10, Heaters On loop Temp <= 20 [1]
▶ Whole paper
Video solution of the whole paper · by Mr Saem. 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.