9618/33/M/J/25 question 9: worked solution (May/June 2025, paper 33)
Show as plain textHide plain text
Cambridge A2 Level Computer Science 9618 · 16.2 Translation Software Worked solution from the System Software Paper 3 Advanced Theory booklet, Part 2 of 2. Q37 9618/33/M/J/25 original Q9 Structured · 6 marks Worked solution (a) JJ90: the second character is J, which is an upper . The second character must be a lower or a digit [1] (b) The second and third characters are each a lower or a digit. Write: <upper> ::= J | K | L | V | X | Z [1] <passcode> ::= <upper><lower><lower><digit> | <upper><lower><digit><digit> | <upper><digit><lower><digit> | <upper><digit><digit><digit> Any two correct options for <passcode> [1] The other two options correct [1] Another correct way: <passcode> ::= <upper><middle><middle><digit> with <middle> ::= <lower> | <digit>. This earns the same two marks. (c) In the diagram, add an upper box as a third choice in the box for the third character, with its own entry and exit lines. Then add a loop line from after the final digit back to just before it, so the final digit can repeat. upper box in the correct place with correct connections [1] Correct repetition arrow round the final digit [1] KEY IDEA Each choice in a syntax diagram is an alternative in BNF, and a loop means the part can repeat. TOTAL 6 marks Official mark scheme VIDEO ▶ Topic lesson A lesson on this topic · by Craig'n'Dave. Tap the picture to open it on YouTube.