Cambridge AS Level Computer Science 9618 · 5.2 Language Translators

Q18 · 9618/11/O/N/23 Q6

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

Q189618/11/O/N/23original Q6Structured · 9 marks
Question 6 from 9618/11/O/N/23

Worked solution

(a)

Compare the interpreter with the compiler. Write four of these:

The interpreter makes the program easier to debug [1]

... because it translates line by line and stops when an error is found, while a compiler translates everything at once [1]

... it reports only one error at a time, so the error can be corrected in real time [1]

The program can restart at the same point after a fix, but a compiled program must be recompiled and re-run [1]

Other accepted points: effects of changes are seen immediately; a partly finished program can be translated and tested on its own.

(b)

Write one of these:

Partially compiled programs can be used on different platforms because they are interpreted when run [1]

Other accepted: code is optimised for the CPU as machine code is made at run time; the source does not need recompiling, so it is more efficient.

(c)(i)

Write any two features for presenting code:

Prettyprint [1]

Expand/collapse code blocks [1]

Auto indentation / formatting also scores.

(c)(ii)

Write any two features for debugging:

Single stepping [1]

Breakpoints [1]

Report window and variable expressions also score.

KEY IDEAAn interpreter translates line by line, so errors are found and fixed in real time, even in unfinished programs.
TOTAL 9 marks

Official mark scheme

Mark scheme for 9618/11/O/N/23 question 6
VIDEO
▶ Starts at Q6 (1:04:09)

Starts at Q6 (1:04:09) · by Pseudocode Pro. 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.