Cambridge AS Level Computer Science 9618 · 5.2 Language Translators

Q15 · 9618/12/M/J/22 Q6

Worked solution from the System Software Paper 1 Theory Fundamentals booklet, Part 2 of 2.

Q159618/12/M/J/22original Q6Structured · 8 marks
Question 6 from 9618/12/M/J/22

Worked solution

(a)

Describe a compiler. Any two of these score:

It tries to translate the whole source code at once [1]

It makes a separate error report at the end of translation [1]

If there are no errors it creates an executable file (also scores if the marks above are not already full)

(b)

Describe an interpreter. Both points score:

It reads each line, translates it and runs it [1]

It stops when it finds an error and shows the error there [1]

(c)

Writing (max 2). Any two of these:

Pretty printing or colour to show key words [1]

Context-sensitive prompts, auto-complete or auto-formatting to help type code [1]

Other accepted answers: expand and collapse code blocks; dynamic syntax checking.

Testing (max 2). Any two of these:

Single stepping to run the code one line at a time [1]

Breakpoints to stop at set points and check values [1]

A report window shows how variables change.

KEY IDEAA compiler translates everything then runs; an interpreter translates and runs line by line; the IDE helps with both writing and testing.
TOTAL 8 marks

Official mark scheme

Mark scheme for 9618/12/M/J/22 question 6
VIDEO
▶ Whole paper

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