Presentation is loading. Please wait.

Presentation is loading. Please wait.

Exercise Design a Design Class for: Vehicle (for a car dealership)

Similar presentations


Presentation on theme: "Exercise Design a Design Class for: Vehicle (for a car dealership)"— Presentation transcript:

1 Exercise Design a Design Class for: Vehicle (for a car dealership)
Attributes Primary Key (1) Instance attribute (4) Class Attribute (1) Method Constructor methods (2) Instance Method Accessor methods (1 get & 1 set) Processing method (1) Class Method (1)

2 Vehicle Solution (an example)
Instance-Level Attributes VIN: string Make: string Model: string Type: string Color: string Year: int MPGhwy: int MPGcity: int DateReceived: DateTime DateSold: DateTime PurchasePrice: double SellingPrice: double PriceSold: double Class-Level Attributes RegistrationFee: double DownPayment%: double MinimumMarkup: double Instance-Level Methods Constructors + CreateVehicle() : Vehicle + CreateVehicle(vin, make, model) : Vehicle Accessors + getMake(): string + setMake(make) ** needs accessors for each attribute Processing Methods + CalcAvgMPG(): double + CalcDaysOnLot(): int + CalcProfit(): double Class-Level method + FindBelowPrice(price): VehicleArray + FindAboveMPG(mpg): VehicleArray + DisplayOldVehicles(date): VehicleArray + FindMostRecentVehicle(): Vehicle


Download ppt "Exercise Design a Design Class for: Vehicle (for a car dealership)"

Similar presentations


Ads by Google