The George Washington University
School of Engineering and Applied Science
Department of Computer Science
CSci 131 -- Algorithms and Data Structures I
Project #2
Due Date: start of class, Monday, February 11, 2002
http://www.seas.gwu.edu/~csci131/spring02/131s02p2.html

This project depends on material through Chapter 3 of the data structures book, as well as on the document Incremental ADT Development Using Stubs, which is online and linked from the course web page.

From Project 1, you now have a basic ADT package Cars for constructing, and retrieving fields from, car records, and a companion child package Cars.IO for reading and writing car records. In this project you are going to develop a table manager, which will be the basis for doing database-type operations on collections of car records. You will use incremental development in this process.

The file car_tables.ads contains the interface (specification) for an ADT package that provides a type TableType. Each TableType variable uses an unsorted array to store up to 25 car records. Methods are provided to insert, delete, retrieve, and replace records, as well as to empty the table and to display its current contents.

The file basic_test_car_tables.adb contains a simple test program to help you  begin the incremental development process. This program just opens a file and reads 5 records, inserting each one into a table and displaying the table contents after each insertion.

Proceed as follows:

  1. Copy and compile the package interface and test program. You won't be able to link because there's no package body yet.
  2. Write a body for the car table package, in which all the method procedure are stubs. Make sure this file compiles correctly.
  3. Use an editor to create a file cars.dat which contains 5 car records. Make sure these have distinct tag values.
  4. Link and run the test program. You won't get much output, because none of the table methods are implemented yet.
  5. Now implement the Insert and Display methods. JUST THESE TWO -- leave the rest as stubs. Once this modified body compiles OK, relink the test program and run the test.
  6. Now write a test plan for incrementally testing all the methods. Make sure your tests are thorough; for example, be sure to test the cases where the operation is not successful and the Success flag is False!
  7. Once you have a successful test, go back and incrementally add table methods, extending your test program as you go. Test each method thoroughly before going to the next method.

What to submit:

Submit several listings for the package body, one for each successful stage in the development; also submit the various versions of your test program, the various incremental test runs, and your test plan.

Grading:

60% Correctness of Programs
20% Code Style
20% Quality of Test Plan