Cambridge A2 Level Computer Science 9618 · 16.2 Translation Software

Q35 · 9618/32/M/J/25 Q9

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

Q359618/32/M/J/25original Q9Structured · 6 marks
Question 9 from 9618/32/M/J/25

Worked solution

(a)

Compare 9K with the variable diagram.

A variable must begin with a letter, but 9K begins with a digit [1]

(b)

List the choices in the operator diagram.

<operator> ::= + | - | * | / | ^ [1]

(c)

The diagram already shows variable and =. After the = circle add a variable box, then an operator box, then a second variable box. Draw a line from after the last variable box back to before the operator box, so the operator and variable can be repeated.

Two variable boxes added after the = circle [1]

One operator box added, and all boxes in the correct order [1]

Connections, arrows and the return loop correct, with no extra boxes [1]

(d)

The variable must start with a letter, then have any letters or digits, and be at least four characters long. Write one example, such as:

AC768 [1]

KEY IDEARead the syntax diagram as rules: where it starts, what can follow, and where a loop lets a part repeat.
TOTAL 6 marks

Official mark scheme

Mark scheme for 9618/32/M/J/25 question 9
VIDEO
▶ Topic lesson

A lesson on this topic · by Craig'n'Dave. 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.