9618/32/O/N/24 question 7: worked solution (October/November 2024, paper 32)
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. Q30 9618/32/O/N/24 original Q7 Structured · 9 marks Worked solution (a) Check each number against the number diagram: an odd digit first, then nothing, or one odd or even digit. 21 is invalid because a number must start with an odd digit and 2 is even. [1] 123 is invalid because a number can only be one or two digits long, not three. [1] (b) <symbol> ::= % | £ | # | @ | $ <number> ::= <odd> | <odd><even> | <odd><odd> <symbol> correct [1] <number> correct [1] (c)(i) Draw in order: letter , then number (a loop or bypass so there is a second optional number), then symbol , then the end. Label it code. Letter, number, symbol in the right order [1] A route allowing one or two numbers [1] All other connections and the label correct, nothing extra [1] (c)(ii) <code> ::= <letter><number><symbol> | <letter><number><number><symbol> First line correct [1] Second line correct [1] A shorter way also scores: write <digits> ::= <number>|<number><number> and <code> ::= <letter><digits><symbol>, one mark for each correct line. KEY IDEA A BNF rule lists the allowed forms with |, and a diagram shows optional parts with a bypass route. TOTAL 9 marks Official mark scheme VIDEO ▶ Whole paper Video solution of the whole paper · by Zafar Ali Khan (ZAK). Tap the picture to open it on YouTube.