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

CSci 131 -- Data Structures
Project #4
Due Date: March 9, 1999

The purpose of this project is to give you some more 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 mostly from Chaps. 5 and 6.

You are hired by the Division of Motor Vehicles to develop a new computer system for keeping track of vehicle registrations. Here is the information to be contained in a motor vehicle variant record:

  • A vehicle can be an auto, a truck, or a motorcycle; use this as the discriminant.
  • For all vehicles, store the license number (this is the search key, 1-7 characters; letters and digits OK), brand name (Chevrolet, Honda, etc. - an enumeration type), purchase price, date of purchase, and owner's name. In addition:
    • For an auto, store the number of doors (2-5) and whether it is a sedan or a station wagon. Also indicate the number of air bags (0-4) [Why up to 4? Because some new cars have side as well as front air bags].
    • For a motorcycle, store the engine cylinder size (in cubic centimeters).
    • For a truck, store the number of axles (2-6) and the weight (in kilos).

The vehicle data base will be an instance of Tables_Generic.

You have two main subtasks in this project:

  1. Develop the base package for Vehicles, using Employees as an example to follow. Also develop an input/output child package, Vehicles.IO, by analogy to Employees.IO. Test these in a sensible way, using other test programs as examples. In writing the IO package, make maximal use of the robust input and enumeration display routines developed in the laboratory exercise.
  2. Develop and test a user interface similar to Employee_UI. You can start with a copy of Employee_UI and just make changes to it.

If you completed Project 3, you should be able to use your Tables_Generic package without a single change.