9618/12/M/J/22 question 6: worked solution (May/June 2022, 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. Q15 9618/12/M/J/22 original Q6 Structured · 8 marks Worked solution (a) Describe a compiler. Any two of these score: It tries to translate the whole source code at once [1] It makes a separate error report at the end of translation [1] If there are no errors it creates an executable file (also scores if the marks above are not already full) (b) Describe an interpreter. Both points score: It reads each line, translates it and runs it [1] It stops when it finds an error and shows the error there [1] (c) Writing (max 2). Any two of these: Pretty printing or colour to show key words [1] Context-sensitive prompts , auto-complete or auto-formatting to help type code [1] Other accepted answers: expand and collapse code blocks; dynamic syntax checking. Testing (max 2). Any two of these: Single stepping to run the code one line at a time [1] Breakpoints to stop at set points and check values [1] A report window shows how variables change. KEY IDEA A compiler translates everything then runs; an interpreter translates and runs line by line; the IDE helps with both writing and testing. TOTAL 8 marks Official mark scheme VIDEO ▶ Whole paper Video solution of the whole paper · by Exam Ninja. Tap the picture to open it on YouTube.