Cambridge AS Level Computer Science 9618 · 12.2 Program Design

Q14 · 9618/22/M/J/22 Q3

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

Q149618/22/M/J/22original Q3Structured · 9 marks
Question 3 from 9618/22/M/J/22

Worked solution

(a)(i)

Head() calls three modules in order and repeatedly, so draw an iteration arc across its three lines. Add the missing parameters: Mod_V takes an INTEGER and Mod_Z takes a REAL.

Iteration arc drawn across the three lines from Head() (A) [1]

Parameter arrow (open circle) going down on the line from A to D, for the INTEGER passed to Mod_V [1]

Parameter arrow (open circle) going down on the line from D to E, for the REAL passed to Mod_Z [1]

(a)(ii)

Match the boxes to the headers. B has one down parameter, so Mod_W. C has a parameter passed both ways (BYREF), so Mod_X. D returns a flag (BOOLEAN), so Mod_V. E returns data, so Mod_Z. F has two parameters down, so Mod_Y.

LabelModule name
AHead
BMod_W
CMod_X
DMod_V
EMod_Z
FMod_Y

Any two rows correct [1]

Four rows correct [1]

All six rows correct [1]

(b)

Any three benefits:

A complex problem is easier to understand and solve when it is broken into smaller problems [1]

Smaller modules are easier to program, test and maintain [1]

Sub-problems can be given to different programmers or teams and solved separately [1]

KEY IDEAIn a structure chart, arrows show parameters and return values, a flag shows a BOOLEAN result and an arc shows repetition.
TOTAL 9 marks

Official mark scheme

Mark scheme for 9618/22/M/J/22 question 3
VIDEO
▶ Whole paper

Video solution of the whole paper · by Awab Aqib. 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.