Worked solution from the Programming Paper 2 Problem-solving and Programming booklet, Part 1 of 3.
Use the DAYINDEX() function. Sunday is 1, so Thursday is 5.
Write: IF DAYINDEX(MyDOB) ... THEN (the function applied to MyDOB) [1]
Write: ... = 5 (the comparison with 5) [1]
Write the two checks that need only one parameter each:
Check the month is between 1 and 12 (inclusive) [1]
Check the year is 2002 or earlier (so the student is at least 18 in 2020) [1]
The day depends on the month.
Write: the check uses the month and the day together [1]
Write: the day must be possible for that month, for example no day 31 in a 30-day month (and a month-based limit for February) [1]
▶ Starts at Q2 (21:00)
Starts at Q2 (21:00) · by Zafar Ali Khan (ZAK). 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.