9618/21/O/N/24 question 7: worked solution (October/November 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. Q26 9618/21/O/N/24 original Q7 Structured · 7 marks Worked solution (a) Use the module headers to place each module and its parameters. Connect is at the top. The left box is Sync (its curved arrow means it repeats calls) and the right box is Activate : Hierarchy: Connect calls Sync and Activate. Sync calls Reset and Enable (bottom left boxes). Activate calls Initialise (bottom right box). [1] Connect to Sync: T1 and S2 going down, and an integer return value going up. Connect to Activate: H1 and Code going down, and a Boolean return value going up. [1] Sync to Reset: RA going down and an integer return value going up. Sync to Enable: SA going down and a Boolean return value going up. [1] Activate to Initialise: CC going down (BYVAL). ID going down and up, because it is BYREF. [1] Draw a decision diamond at the bottom of Connect, because it calls either Sync or Activate [1] (b) Say what the curved arrow means: It means iteration (repetition) [1] Sync repeatedly calls Reset and then Enable, in that order [1] KEY IDEA In a structure chart a diamond means a choice between modules and a curved arrow means repetition of the calls. TOTAL 7 marks Official mark scheme VIDEO ▶ Whole paper Video solution of the whole paper · by Pseudocode Pro. Tap the picture to open it on YouTube.