Vehicle Inventory Database - PowerPoint PPT Presentation

1 / 10
About This Presentation
Title:

Vehicle Inventory Database

Description:

Trucks have certain attributes that differ from sedans and motorcycles. ... Area of the bed of the truck. ( integer) Sedans. Number of doors. ( integer) ... – PowerPoint PPT presentation

Number of Views:46
Avg rating:3.0/5.0
Slides: 11
Provided by: markst4
Learn more at: http://www3.nd.edu
Category:

less

Transcript and Presenter's Notes

Title: Vehicle Inventory Database


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 (cont)
  • 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.
Write a Comment
User Comments (0)
About PowerShow.com