Cambridge AS Level Computer Science 9618 · 12.2 Program Design

Q24 · 9618/22/M/J/24 Q7

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

Q249618/22/M/J/24original Q7Structured · 9 marks
Question 7 from 9618/22/M/J/24

Worked solution

(a)

Decomposition splits a big job into small jobs. Write three sub-modules, each with its use (any three):

IdentifyMember() – finds a club member who has asked to join the class that now has a free space [1]

GetMemberPhoneNumber() – gets the mobile phone number of a member [1]

CreateMessage() – makes the text message for a member [1]

Other correct sub-modules also score, for example SendMessage(), which sends the text message to a member on the waiting list.

(b)(i)

Start in S1 and follow the arrows. The current state of each row is the next state of the row above:

InputOutputNext state
S1
Input-AnoneS3
Input-AOutput-WS3
Input-BnoneS2
Input-BnoneS5
Input-AnoneS2
Input-AOutput-XS4

Row 3: Input-A, Output-W, S3 (the loop on S3) [1]

Row 4: Input-B, none, S2 [1]

Row 5: Input-B, none, S5 [1]

Row 6: Input-A, none, S2 [1]

Row 7: Input-A, Output-X, S4 [1]

(b)(ii)

The shortest route from S1 to S4 is S1 → S2 (Input-B) then S2 → S4 (Input-A), which is two changes.

Write: Input-B, Input-A [1]

KEY IDEAFollow a state-transition diagram one arrow at a time, and write the input, output and new state for each step.
TOTAL 9 marks

Official mark scheme

Mark scheme for 9618/22/M/J/24 question 7
VIDEO
▶ Starts at Q7 (1:03:19)

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