Worked solution from the Software Development Paper 2 Problem-solving and Programming booklet, Part 3 of 3.
Write any two tools, each with what it does:
Set a breakpoint [1]
It stops the program at a chosen line so the values of variables can be checked at that point [1]
Use a watch window (report window) [1]
It shows the values of chosen variables as the program runs [1]
Single stepping also scores: it runs one line at a time so the effect of each statement can be seen.
Statement 1: the brackets are in the wrong place. A number (2) is added to a string ("27"), which is not valid, and STR_TO_NUM needs a string. [1]
Statement 2: no error. [1]
Statement 3: MONTH() returns an integer but it is compared with a character '6'. The 6 should not be in quotes. [1]
Work each one out with Active = TRUE, Points = 75, Exempt = FALSE:
| Expression | Evaluation |
|---|---|
| (Points > 99) OR Active | TRUE |
| (Points MOD 2 = 0) OR Exempt | FALSE |
| (Points <= 75) AND (Active OR Exempt) | TRUE |
| (Active OR NOT Active) AND NOT Exempt | TRUE |
Any two rows correct [1]
All four rows correct [1]
Active OR NOT Active is always TRUE, so only the second part is left:
NOT Exempt [1]
▶ Starts at Q1 (0:21)
Starts at Q1 (0:21) · 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.