Cambridge O Level Computer Science 2210 · 4.2 Types of programming language, translators and integrated development environments (IDEs)

Q15 · 2210/12/O/N/21 Q6

Worked solution from the Software Paper 1 Computer Systems booklet, Part 2 of 2.

Q152210/12/O/N/21original Q6Structured · 6 marks
Question 6 from 2210/12/O/N/21

Worked solution

(a)

Write one thing both do, for example:

Both translate high-level language into machine code (low-level language) [1]

Also accepted: both check for errors, or both report errors.

(b)

Give two differences. Say what the interpreter does, then what the compiler does.

Difference 1: an interpreter translates and runs the code line by line [1]

... whereas a compiler translates the whole program in one go [1]

Difference 2: an interpreter stops and reports an error as soon as it finds one [1]

... whereas a compiler gives an error report at the end of translation (and will not run any code if there are errors) [1]

Other accepted differences: a compiler produces an executable file but an interpreter does not; an interpreter lets you correct errors straight away, but a compiler must translate again after each correction.

(c)

Another type of translator is an assembler [1]

KEY IDEAA compiler translates everything at once and makes an executable file; an interpreter translates and runs one line at a time.
TOTAL 6 marks

Official mark scheme

Mark scheme for 2210/12/O/N/21 question 6
VIDEO
▶ Whole paper

Video solution of the whole paper · by Level Up with Aqeel Ahmed: CS Edition. 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.