Cambridge A2 Level Computer Science 9618 · 16.2 Translation Software

Q30 · 9618/32/O/N/24 Q7

Worked solution from the System Software Paper 3 Advanced Theory booklet, Part 2 of 2.

Q309618/32/O/N/24original Q7Structured · 9 marks
Question 7 from 9618/32/O/N/24

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 IDEAA BNF rule lists the allowed forms with |, and a diagram shows optional parts with a bypass route.
TOTAL 9 marks

Official mark scheme

Mark scheme for 9618/32/O/N/24 question 7
VIDEO
▶ Whole paper

Video solution of the whole paper · 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.