The George Washington University
School of Engineering and Applied Science
Department of Electrical Engineering and Computer Science

CSci 131 -- Data Structures
Project #2

Due Date: Oct. 15, 1996 (sect. 10); Oct. 14, 1996 (sect. 11)

The purpose of this project and Project 4 is to give you some practice in dealing with generic packages, and illustrate the advantages of a clearly-specified generic interface in supporting multiple implementations and multiple clients. This project uses material from Chaps. 2, 3, and 5.

In Project 2 you developed a package to handle a table of employee records. Program 5.19 presents a generic version of a table package, Tables_Generic. The body of this package uses an ordered array implementation of the table objects, and so instantiates Binary_Search_Generic (Programs 5.12 and 5.14) to provide a table-searching operation. The package operations are "stubbed out", containing only some calls to Debugging_Support to display an "under construction" message.

(A) Reimplement the employee database using the generic keyed table package, instantiating the package for Employee. That is,

  1. complete the body and then test it using a revised version of Test_Employee_Table.
  2. integrate the new table handler into Employee_UI.

You should be able to reuse almost all your Project 2 work directly. Employee_UI will need some small changes, to refer to the new table package insetad of the old one.

(B) Improve the package Tables_Generic.Backup (Programs 5.21 and 5.22) so that exceptions raised by the file system are handled within the package operations Save and Restore.

(C) Complete the airline passenger list project outlined in Section 5.10. That is,

  1. develop a Passengers and a Passengers.IO package. These are not provided online, but are straightforwardly developed from the book specifications, using Employees as a model. Test these packages using a test program based on your previous work.
  2. use Employee_UI as an example to develop a Passenger_UI program that instantiates the table package for the passenger case.