Cambridge AS Level Computer Science 9618 · 12.2 Program Design

Q23 · 9618/21/M/J/24 Q7

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

Q239618/21/M/J/24original Q7Structured · 12 marks
Question 7 from 9618/21/M/J/24

Worked solution

(a)(i)

Write: it makes the problem easier to design, solve or implement [1]

(a)(ii)

Pick three items the text module needs and say why. Any three of these:

Mobile phone number - to send the text message [1]

Name - to personalise the message [1]

Exercise interest - to decide whether this member would be interested in the class [1]

(a)(iii)

Any two operations when a reply comes in:

Add the member to the list for the new class [1]

Remove the member from future messages (when the reply is STOP), or read / process the message, or find out who sent it [1]

(b)(i)

A diamond on a structure chart means selection.

It shows selection (a decision): Update calls only one of the modules [1]

Name all four modules: Update calls one of Sub-A, Sub-B or Sub-C [1]

(b)(ii)

Sub-A is a procedure with Name going in and P2 going both ways (BYREF). Sub-B is a function with P1 going in and T1 coming back, both real.

PROCEDURE Sub-A(Name : STRING, BYREF P2 : BOOLEAN)
FUNCTION Sub-B(P1 : REAL) RETURNS REAL

Sub-A: PROCEDURE Sub-A [1]

Sub-A: the parameters (Name : STRING, BYREF P2 : BOOLEAN) [1]

Sub-B: FUNCTION Sub-B with the parameter (P1 : REAL) [1]

Sub-B: RETURNS REAL [1]

KEY IDEAAbstraction keeps only what a task needs; on a structure chart, a diamond means selection and a two-way arrow means BYREF.
TOTAL 12 marks

Official mark scheme

Mark scheme for 9618/21/M/J/24 question 7
VIDEO
▶ Starts at Q7 (1:05:13)

Starts at Q7 (1:05:13) · 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.