9618/12/M/J/21 question 7: worked solution (May/June 2021, paper 12)
Show as plain textHide plain text
Cambridge AS Level Computer Science 9618 · 5.2 Language Translators Worked solution from the System Software Paper 1 Theory Fundamentals booklet, Part 2 of 2. Q12 9618/12/M/J/21 original Q7 Structured · 8 marks 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 IDEA A 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 VIDEO ▶ Whole paper Video solution of the whole paper · by O/Alevel CS by Wasiq. Tap the picture to open it on YouTube.