9618/21/M/J/23 question 7: worked solution (May/June 2023, 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. Q17 9618/21/M/J/23 original Q7 Structured · 8 marks Worked solution (a) Decomposition splits the job into smaller modules. Write any three, each with its name and use: GetOverdueLoan() identifies a book that is overdue [1] GetStudentEmail() gets the email address of the student with the overdue book [1] CreateEmail() (or SendEmail() ) generates (or sends) the email to that student [1] IdentifyStudent(), which finds the student with an overdue book, is also accepted. (b)(i) Module-A calls the other three modules (B, C and D). [1] The call is made again and again: the curved arrow on the chart shows repetition . [1] (b)(ii) Draw Module-D at the top with a selection diamond under it. Draw Module-X and Module-Y underneath, each joined to the diamond: All three rectangles labelled Module-D, Module-X and Module-Y, and joined correctly [1] On the line to Module-Y only: two down arrows with open circles (the string and the real number) and one up arrow with a filled circle (the returned Boolean). Nothing on the line to Module-X, which has no parameters [1] A selection diamond under Module-D, because it calls either X or Y [1] KEY IDEA A structure chart shows each module's callers, with a diamond for selection, a curved arrow for repetition and arrows for data passed. TOTAL 8 marks Official mark scheme VIDEO ▶ Starts at Q7 (51:35) Starts at Q7 (51:35) · by Pseudocode Pro. Tap the picture to open it on YouTube.