Worked solution from the Algorithm design and problem-solving Paper 2 Algorithms, Programming and Logic booklet, Part 5 of 8.
Three types of test data for the range check 1 to 100:
Type 1: normal data [1]
Example: 25 (any value from 2 to 99) [1]
Outcome: accepted [1]
Type 2: extreme data (the largest and smallest acceptable values) [1]
Example: 1 or 100 [1]
Outcome: accepted [1]
Type 3: abnormal data (not allowed) [1]
Example: 125 (or 0, -5) [1]
Outcome: rejected [1]
Boundary data also scores as a type: for example 1 and 0, or 100 and 101, where the first is accepted and the second is rejected.
▶ 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.