9618/21/M/J/24 question 7: worked solution (May/June 2024, paper 21)
Show as plain textHide 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. Q23 9618/21/M/J/24 original Q7 Structured · 12 marks 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 IDEA Abstraction 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 VIDEO ▶ Starts at Q7 (1:05:13) Starts at Q7 (1:05:13) · by Pseudocode Pro. Tap the picture to open it on YouTube.