Cambridge AS Level Computer Science 9618 · 5.2 Language Translators

Q12 · 9618/12/M/J/21 Q7

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

Q129618/12/M/J/21original Q7Structured · 8 marks
Question 7 from 9618/12/M/J/21

Worked solution

(a)

A program library holds code that is already written.

Write: the library stores pre-written functions and routines [1]

Write: Jennifer imports or references the library and then calls its routines from her own program [1]

(b)(i)

Say when each translator is used and why. Interpreter (max 3 marks):

She uses an interpreter while writing the program, to test and debug the part-finished program [1]

Errors can be corrected as they are found and the program carries on from where it stopped (errors are shown one at a time) [1]

Compiler (max 3 marks):

She uses the compiler once the program is complete to create an executable file [1]

She can use the compiler to test the same finished section again and again without translating it every time, because the compiler is not needed at run-time [1]

(b)(ii)

Any two debugging tools:

Breakpoints [1]

Single stepping [1]

Report windows (showing variable values) also score.

KEY IDEAA library gives ready-made routines; use an interpreter while the program is unfinished and a compiler once it is complete.
TOTAL 8 marks

Official mark scheme

Mark scheme for 9618/12/M/J/21 question 7
VIDEO
▶ Whole paper

Video solution of the whole paper · by O/Alevel CS by Wasiq. 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.