
Students' Guide to
Program
Design
A pseudocode example of two data coupled modules follows:
A Process-Customer-Record
Calculate-Discount (total price, discount)
END
B Calculate-Discount (total-price, discount)
IF total-price < £10.00 THEN
discount = total-price • 0.25
ELSE
IF total-price < £100.00 THEN
discount = total-price • 0.3
ELSE
discount = total-price * 0.4
ENDIF
ENDIF
END
In this example, the only connection between the two modules is
the passing of the variables 'total-price' and 'discount' between them.
6 A summary of coupling levels
When designing solution algorithms, the programmer should aim
towards module independence and a minimu ...