Worked solution from the System Software Paper 3 Advanced Theory booklet, Part 2 of 2.
Check each passcode against the passcode diagram: it starts with an uppercase letter, then any number of lowercase letters, symbols or digits.
#Jd7: it begins with a symbol, but it must begin with an uppercase letter [1]
C%6A: the fourth character A is uppercase, but after the first character only lowercase, symbol or digit are allowed [1]
The loop in the diagram becomes a recursive rule in BNF.
<uppercase> ::= A | C | E | G | J
<passcode> ::= <uppercase><code>
<code> ::= <lowercase> | <symbol> | <digit> |
<lowercase><code> | <symbol><code> | <digit><code><uppercase> ::= A | C | E | G | J [1]
<passcode> ::= <uppercase><code> (an uppercase letter followed by the repeating part) [1]
<code> includes the three single options <lowercase> | <symbol> | <digit> [1]
<code> includes the three recursive options, each followed by <code> [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.