Presentation is loading. Please wait.

Presentation is loading. Please wait.

Vehicle Inventory Database Adolfo Fabrega Steve Go CSE 331 Data Structures December 9, 2002.

Similar presentations


Presentation on theme: "Vehicle Inventory Database Adolfo Fabrega Steve Go CSE 331 Data Structures December 9, 2002."— Presentation transcript:

1 Vehicle Inventory Database Adolfo Fabrega Steve Go CSE 331 Data Structures December 9, 2002

2 Purpose This database manages different kinds of vehicles. A car dealership may consider this database a tool to keep track of their inventory. This project deals with vehicles such as trucks, sedans, and motorcycles.

3 Trucks Trucks have certain attributes that differ from sedans and motorcycles. Weight (in tons) a truck can hold. (integer) Area of the bed of the truck. (integer)

4 Sedans Number of doors. (integer) Amount of passengers it can hold. (integer)

5 Motorcycle Engine capacity. (integer) Warranty guarantor that is needed for all 2-wheelers. (string)

6 Commands Import. (I) Add. (A) Browse for and display a vehicle with a particular serial number. (B) Display data for all the vehicles in the database. (D) Search for and remove a vehicle with a particular serial number. (R) Save the list of Vehicles in a named file. (S) Quit. (Q)

7 Implementation Designed the 3 different classes with their own “display” function. They are implemented in separate files with appropriate inclusions of headers. Reading in data proved to be the difficult part because there are many different kinds of vehicles (w/ different attributes) to be read in.

8 Pseudo-Code of Read In Vehicle *v //pointer while (!eof(input_file)) { Read the type indicator from the file if (type indicator says “TRUCK”) { read in all data for truck v = Truck } else if (type indicator says “SEDAN”) { read in all data for a sedan

9 Pseudo-Code (con’t) v = Sedan } else if (type indicator says “MOTORCYCLE”) { read in all data for a motorcycle v = Motorcyles } else error in type indicator database.add_vehicle(v);

10 In the Future... This database could be extended by adding more different types of vehicles such as vans, minivans, SUVs, etc… Can design a more elaborate and intricate GUI for the database w/ more attributes.


Download ppt "Vehicle Inventory Database Adolfo Fabrega Steve Go CSE 331 Data Structures December 9, 2002."

Similar presentations


Ads by Google