Worked solution from the Algorithm design and problem-solving Paper 2 Algorithms, Programming and Logic booklet, Part 5 of 8.
Test data for a range of 1 to 100 inclusive:
Normal test data: 50 (any number from 1 to 100) [1]
Reason: it is within the range and should be accepted [1]
Extreme test data: 1 or 100 [1]
Reason: it is at the lowest or highest end of the range and should be accepted [1]
Erroneous test data: 300 (any value outside 1 to 100, or a different data type such as the letters "abc") [1]
Reason: it is outside the range and should be rejected [1]
▶ Topic lesson
A lesson on this topic · by Craig'n'Dave. 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.