9618/32/M/J/23 question 3: worked solution (May/June 2023, paper 32)

Show as 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. Q23 9618/32/M/J/23 original Q3 Structured · 9 marks Worked solution (a) A variable is one or more letters, then at most one digit. It must begin with a letter. 9SW: invalid , because it begins with a digit and a variable must begin with a letter [1] UWY: valid , because it begins with a letter and is followed by two other letters [1] (b) <word> is one or more letters, so it needs a rule that repeats itself: <word> ::= <letter> | <word><letter> <variable> ::= <word> | <word><digit> <word> ::= <letter> | [1] ... <word><letter> [1] <variable> ::= <word> | <word><digit> [1] Also accepted: <word> ::= <letter><word> | <letter>. (c)(i) Use two letters and one to three digits from the diagrams. Write an example such as AC768 [1] (c)(ii) Draw a diagram named vehicle registration , with an arrow in and an arrow out, in this order: letter box, letter box, digit box, then a second digit box and a third digit box that can each be skipped by a bypass line. Always exactly two letters (two letter boxes, no loops) [1] One, two or three digits possible (the extra digit boxes can be bypassed) [1] Correct arrows, boxes and name of the syntax diagram [1] KEY IDEA Fixed counts are drawn as separate boxes; optional extras are boxes with a bypass line. TOTAL 9 marks Official mark scheme VIDEO ▶ Whole paper Video solution of the whole paper · by qiphyedu. Tap the picture to open it on YouTube.