9618/22 May/June 2022 · Question 3 · 9 marks
Five module headers are given (Mod_V to Mod_Z); Head() repeatedly calls three of the modules in sequence. (a)(i) Complete the structure chart (no parameter labels, no module names). (ii) Write each module name in place of the labels A to F. (b) Describe three benefits of decomposition.
Points that gain marks
- (a)(i) The iteration arrow under A; the parameter arrows (data couples) for each module, including the flag returned to A by D and the return value from E.
- (ii) A Head, B Mod_W, C Mod_X, D Mod_V, E Mod_Z, F Mod_Y.
- (b) Smaller problems are easier to understand and solve; easier to program, test and maintain; sub-problems can be given to different programmers or teams.
In this lab: Level 4 is part (a)(ii); level 5 covers part (b)'s idea.