Structure Chart Questions 1-5
Structure Chart Questions 1-5
2
1 (a) Three modules form part of a program for a car rental company. A description of the
relationship between the modules is summarised as follows:
RentCar1) show
used to
& this is
a variable is being
that
referencee.
passed by
By Card
?
True False
Current
Hire cost ,
Hire
O
>0
↑
O
Balance
*
arow is value
circle
bodean
a
Pay ByAccount()
PayByCard()
[5]
© UCLES 2020 9608/21/M/J/20 [Turn over
2
4
3
2 (a) The module headers for five modules in a program are defined in pseudocode as follows:
L
PROCEDURE Mod_W(P4 : INTEGER)
S
·
(i) Complete the structure chart to include the information given about the six modules.
Do not label the parameters and do not write the module names.
A
-
ro 8 o
mach
T
~
& murth
B C D
Funder E
I
F
n
P [3]
(ii) Complete the table using the information in part 3(a) by writing each module name to
replace the labels A to F.
A Head 11
B Mod-W
C mod-Y
D
-~
Mod
E Mod-2
F mod -
Y
[3]
(b) The structure chart represents part of a complex problem. The process of decomposition is
used to break down the complex problem into sub-problems.
different tasks
...................................................................................................................................................
·
...................................................................................................................................................
to
small programs are easier
program .
3 ................................................................................................................................................
...................................................................................................................................................
5 [3]
32 (a) A structure chart is often used in modular program design. One feature shown is the sequence
of module execution.
Hierarchy
Feature 1 ..................................................................................................................................
...................................................................................................................................................
modules-
...................................................................................................................................................
Decisions
Feature 3 ..................................................................................................................................
...................................................................................................................................................
Iteration
Feature 4 ..................................................................................................................................
...................................................................................................................................................
[4]
54 The module headers for three modules in a program are defined in pseudocode as follows:
A fourth module, Renew(), calls the three modules in the following sequence.
Validate()
Lookup()
Update()
Draw a structure chart to show the relationship between the four modules and the parameters
passed between them.
Renew ()
7
⑧
o
M4 -
--
Th
⑧
ja
p4 ~ O
P3
·
~
W
[7]
53 The following pseudocode represents three separate modules from an algorithm design. The
module contents are not shown.
ENDFUNCTION
ENDFUNCTION
ENDPROCEDURE
PROCEDURE Setup()
Authorised Allocate()
CALL Enable(ThisValue, 4)
ENDWHILE
ENDPROCEDURE
(a) Draw a structure chart to show the four modules and the parameters that these pass between
them.
[6]
(b) The algorithm is implemented in a high-level language. Changes are required and the
program is given to Albert, who is an experienced programmer. He is not familiar with the
language that has been used.
...................................................................................................................................................
...................................................................................................................................................
...................................................................................................................................................
............................................................................................................................................. [2]