9618/12/M/J/23 question 7: worked solution (May/June 2023, paper 12)

Show as 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. Q16 9618/12/M/J/23 original Q7 Structured · 16 marks Worked solution (a)(i) Define a program library: A set of pre-written (pre-compiled, pre-tested) subroutines [1] ... that can be called in other programs by installing or importing the library [1] (a)(ii) Give a benefit (1 mark) and explain it (1 mark). Any two pairs: The memory needed by the program is smaller [1] ... because the DLL is loaded only once, or only when needed [1] The executable file is smaller [1] ... because it does not contain all the library routines [1] Other accepted pairs: no need to recompile the main program when the DLL changes, because changes are made separately; one DLL file can be shared by several programs, saving memory; the programmer does not need to maintain it inside the program. (b) Choose an interpreter (no mark for the choice). Justify, any three of these: The developer can make changes in real time and debug at each stage [1] The effect of changes is seen immediately [1] The developer can test an unfinished program in small parts, and if one section fails, others can still be tested [1] This avoids dependent errors (also scores if the marks above are not already full) A compiler is also accepted if justified: it finds many errors at once and makes an executable that can be tested many times without recompiling. Only three marks are available. (c) Complete the table: Feature Description Breakpoints Stop the code at a set line to check the progress or values Dynamic syntax checks Highlight or underline syntax errors as the code is typed Context-sensitive prompts Suggest code to add or complete statements automatically Single stepping Run the code one line at a time so values can be checked Breakpoints [1] Dynamic syntax checks [1] Context-sensitive prompts [1] Single stepping [1] (d) Explain the use of AI. Any three of these: The program uses speech recognition [1] ... which identifies key words or phrases that are spoken [1] ... and matches them to a database [1] ... and generates the most likely word, sentence or command (also scores if the marks above are not already full) Only three marks are available. KEY IDEA A library and DLL save effort and memory; an interpreter suits unfinished code, and AI speech recognition matches sounds to known words. TOTAL 16 marks Official mark scheme VIDEO ▶ Starts at Q7 (1:17:40) Starts at Q7 (1:17:40) · by Zafar Ali Khan (ZAK). Tap the picture to open it on YouTube.