Cambridge AS Level Computer Science 9618 · 12.3 Program Testing and Maintenance

Q50 · 9618/22/O/N/24 Q1

Worked solution from the Software Development Paper 2 Problem-solving and Programming booklet, Part 3 of 3.

Q509618/22/O/N/24original Q1Structured · 9 marks
Question 1 from 9618/22/O/N/24

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 nameUsed to storeData type
NameA customer nameSTRING
IndexAn array indexINTEGER
ResultThe result of the division of any two non-zero numbersREAL

Name: STRING [1]

Index: INTEGER [1]

Result: REAL [1]

KEY IDEAUse 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

Mark scheme for 9618/22/O/N/24 question 1
VIDEO
▶ Whole paper

Video solution of the whole paper · by Papersdock. Tap the picture to open it on YouTube.

Solutions follow the official Cambridge mark schemes; marks are shown in grey. Videos are from other YouTube channels. Paper codes read component / series / year: M/J = May/June, O/N = October/November. Past-paper questions © UCLES, reproduced for classroom practice.