Cambridge A2 Level Computer Science 9618 · 16.2 Translation Software

Q22 · 9618/31/M/J/23 Q6

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

Q229618/31/M/J/23original Q6Structured · 8 marks
Question 6 from 9618/31/M/J/23

Worked solution

(a)

A password is letters (A, D, P, R, Y), then digits, then symbols ($, %, &, @, #), each part repeated or skipped as the diagram allows, in that order.

DPAD99$: valid, because it is several letters, then several digits, then a symbol [1]

DAD#95: invalid, because the symbol comes before the digits; it should be after [1]

ADY123?: invalid, because ? is not a valid symbol [1]

(b)

Write each list with |:

<symbol> ::= $ | % | & | @ | #
<letter> ::= A | D | P | R | Y

Both lines correct (all five symbols and all five letters, no extras) [1]

(c)

The diagram starts with a letter box that can be repeated, then a digit box that can be repeated or skipped.

Draw a diagram named identifier, with an arrow in and an arrow out. It starts with a letter box [1]

A loop around the letter box lets the letter repeat, and a digit box follows (digit present) [1]

A loop around the digit box lets the digit repeat, and a bypass line lets it be skipped [1]

Correct structure: name, boxes and arrows in and out [1]

Another accepted layout: letter, then a second letter box with a loop, then a digit box with a loop and a bypass.

KEY IDEAIn a syntax diagram, a loop means repeat and a bypass line means optional.
TOTAL 8 marks

Official mark scheme

Mark scheme for 9618/31/M/J/23 question 6
VIDEO
▶ Whole paper

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