9618/22/M/J/24 question 7: worked solution (May/June 2024, paper 22)

Show as plain text

Cambridge AS Level Computer Science 9618 · 12.2 Program Design Worked solution from the Software Development Paper 2 Problem-solving and Programming booklet, Part 2 of 3. Q24 9618/22/M/J/24 original Q7 Structured · 9 marks 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: Input Output Next state S1 Input-A none S3 Input-A Output-W S3 Input-B none S2 Input-B none S5 Input-A none S2 Input-A Output-X S4 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 IDEA Follow 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 VIDEO ▶ Starts at Q7 (1:03:19) Starts at Q7 (1:03:19) · by Pseudocode Pro. Tap the picture to open it on YouTube.