Cambridge AS Level Computer Science 9618 · 12.2 Program Design

Q22 · 9618/23/O/N/23 Q7

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

Q229618/23/O/N/23original Q7Structured · 7 marks
Question 7 from 9618/23/O/N/23

Worked solution

(a)

A curved arrow means a loop.

It shows iteration (repetition) [1]

Module-A() repeatedly calls Sub-Y1(), then Sub-Y2(), then Sub-9() in that order [1]

(b)(i)

The record holds the two parameters and the returned Boolean value.

TYPE MyType
    DECLARE RA : INTEGER
    DECLARE RB : STRING
    DECLARE RC : BOOLEAN
ENDTYPE

TYPE MyType ... ENDTYPE structure [1]

RA declared as INTEGER and RB declared as STRING [1]

A third field declared as BOOLEAN [1]

(b)(ii)

The procedure changes the record, so the parameter is passed by reference.

PROCEDURE Sub-9(BYREF Param : MyType)

BYREF used [1]

The rest of the header correct: PROCEDURE Sub-9, a parameter name and type MyType [1]

KEY IDEAA curved arrow on a structure chart means repetition; a record groups values of different types under one name.
TOTAL 7 marks

Official mark scheme

Mark scheme for 9618/23/O/N/23 question 7
VIDEO
▶ Starts at Q7 (1:42:39)

Starts at Q7 (1:42:39) · by Zafar Ali Khan (ZAK). 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.