COMP1011 Exercises for Week 10
Computing 1A 05s2 Last updated Tue 19 Jul 2005 14:37
Mail cs1011@cse.unsw.edu.au

Tute Exercises Week 10

Modules

This week's tute and lab exercises are based on the address book example discussed in the lecture.

Modular Design

The following interfaces and (incomplete) modules implement the module structure for the application as discussed in the lecture.
  1. Which modules will be affected if we extend the definition of Address?

  2. In the current version, Address is exported with its constructors, since the user interface module needs the informations to construct, read and print addresses. Assume an address will always consist of at least first name, last name and telephone number. Change the interface of AddressDB such that altering the definition of Address does not directly affect other modules. What are the disadvantages of such a solution?

  3. Design a new type Address which, in addition to the fields of the current type, has the following optional fields: and provide functions to set these fields.