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 10, 1998

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 record:

  • A vehicle can be an auto, a truck, or a motorcycle;
  • For all vehicles, store the license number (this is the search key, 1-7 characters; letters and digits OK), brand name (Chevrolet, Honda, etc. - up to 20 chars.), 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 record will be a variant record; 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 othr test programs as examples.
  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 will be able to use your Tables_Generic package without a single change.