9618/22/O/N/24 question 1: worked solution (October/November 2024, paper 22)

Show as plain text

Cambridge AS Level Computer Science 9618 · 12.3 Program Testing and Maintenance Worked solution from the Software Development Paper 2 Problem-solving and Programming booklet, Part 3 of 3. Q50 9618/22/O/N/24 original Q1 Structured · 9 marks Worked solution (a) Fixing an error in a released program is maintenance. Write: corrective maintenance [1] (b) Say what each feature does and in what order they are used: First set a breakpoint at the start of (or inside) Lookup(). This stops the program at that line [1] Then use single stepping to run one statement at a time [1] Use the watch window to show the values of variables as each line runs, to spot where the value goes wrong [1] (c) Write any two features that help while coding: Auto-complete / auto-correction of keywords and names [1] Pretty print / auto-indentation, or dynamic syntax checking, or context-sensitive prompts, or collapsing code blocks [1] (d) Choose the type that suits the data: Variable name Used to store Data type Name A customer name STRING Index An array index INTEGER Result The result of the division of any two non-zero numbers REAL Name: STRING [1] Index: INTEGER [1] Result: REAL [1] KEY IDEA Use a breakpoint to stop, single stepping to go line by line, and a watch window to see the variable values. TOTAL 9 marks Official mark scheme VIDEO ▶ Whole paper Video solution of the whole paper · by Papersdock. Tap the picture to open it on YouTube.