2210/12/O/N/21 question 6: worked solution (October/November 2021, paper 12)
Show as plain textHide plain text
Cambridge O Level Computer Science 2210 · 4.2 Types of programming language, translators and integrated development environments (IDEs) Worked solution from the Software Paper 1 Computer Systems booklet, Part 2 of 2. Q15 2210/12/O/N/21 original Q6 Structured · 6 marks 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 IDEA A 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 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.