9618/23/O/N/23 question 7: worked solution (October/November 2023, paper 23)
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. Q22 9618/23/O/N/23 original Q7 Structured · 7 marks 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 IDEA A curved arrow on a structure chart means repetition; a record groups values of different types under one name. TOTAL 7 marks Official mark scheme 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.