Worked solution from the Software Development Paper 2 Problem-solving and Programming booklet, Part 3 of 3.
Black-box testing uses inputs and expected outputs only. One test string should show every requirement, so it needs a space before the first word, a space after the last word, several spaces between words, and capital letters. For example:
∇∇Hello∇∇∇World∇
The string must have all four of these features: at least one leading space, at least one trailing space, multiple spaces between two words and at least one upper case letter.
At least one feature present [1]
Three features present [1]
All four features present [1]
Any two of these ways of finding where the assignment is missed:
Dry run the code with a trace table, or walk through it, to see when the assignment line is skipped [1]
Use a breakpoint (or single-step and watch variables) to see whether FString is set; or add output statements to track the code; or try different test strings to find which ones fail [1]
▶ Whole paper
Video solution of the whole paper · by Papersdock. 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.