Cambridge AS Level Computer Science 9618 · 12.2 Program Design

Q26 · 9618/21/O/N/24 Q7

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

Q269618/21/O/N/24original Q7Structured · 7 marks
Question 7 from 9618/21/O/N/24

Worked solution

(a)

Use the module headers to place each module and its parameters. Connect is at the top. The left box is Sync (its curved arrow means it repeats calls) and the right box is Activate:

Hierarchy: Connect calls Sync and Activate. Sync calls Reset and Enable (bottom left boxes). Activate calls Initialise (bottom right box). [1]

Connect to Sync: T1 and S2 going down, and an integer return value going up. Connect to Activate: H1 and Code going down, and a Boolean return value going up. [1]

Sync to Reset: RA going down and an integer return value going up. Sync to Enable: SA going down and a Boolean return value going up. [1]

Activate to Initialise: CC going down (BYVAL). ID going down and up, because it is BYREF. [1]

Draw a decision diamond at the bottom of Connect, because it calls either Sync or Activate [1]

(b)

Say what the curved arrow means:

It means iteration (repetition) [1]

Sync repeatedly calls Reset and then Enable, in that order [1]

KEY IDEAIn a structure chart a diamond means a choice between modules and a curved arrow means repetition of the calls.
TOTAL 7 marks

Official mark scheme

Mark scheme for 9618/21/O/N/24 question 7
VIDEO
▶ Whole paper

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