CSci 131 -- Data Structures
Project #6
Due Date: April 29, 1999 (the university make-up day for the snow day)
THIS IS A FINAL DEADLINE - NO LATE PROJECTS CAN BE ACCEPTED!
The purpose of this project is to gain more experience with linked lists, and also to explore active-iteration techniques. You will extend your Project 5 table package, and modify the Vehicles user interface client.
(A) Make a minor modification to Vehicles and Vehicles.IO, such that the vehicle brand is an enumeration type instead of a string.
TYPE Brands IS (Ford, Toyota, Volvo, Honda, Kia, Yamaha);Re-test with your Project 5 vehicles user interface.
(B) Add LAVS (list-of-available-space) storage management (Section 9.2) to the linked-list tables package. Modify InitializeTable, Insert and Delete accordingly.
(C) Add active-iterator functionality (Section 9.6) to the linked-list table package.
PACKAGE Tables_Generic.Iteration IS PROCEDURE StartTraversal (T: IN OUT TableType); FUNCTION RetrieveCurrentElement (T: TableType) RETURN Element; FUNCTION MoreElements (T: TableType) RETURN Boolean; PROCEDURE MoveToNextElement (T: IN OUT TableType); PROCEDURE StopTraversal (T: IN OUT TableType); END Tables_Generic.Iteration;(D) Add a new capability to the user interface.
Auto Truck Motorcycle ------------------------------------ Ford 1 2 0 Toyota 2 0 0 Volvo 0 1 0 Honda 4 0 3 Kia 1 0 0 Yamaha 0 0 4