Question: please I need help with htis program in c++: Creating a program to manage cars in a dealership. This will again be a menu driven

please I need help with htis program in c++:

Creating a program to manage cars in a dealership. This will again be a menu driven system. You will make a vector of Dealers (there can be zero to many dealers). Each dealer can have zero to many cars on the lot, represented not by a vector, but by a dynamic array. The following is your menu:

1. Read Dealers and Cars from file 2. Display Dealers 3. Choose a Dealer Number, Display Cars 4. Choose a Dealer Number, Add Car 5. Choose a Dealer, Sort cars by VIN (EXTRA CREDIT) 6. Write Dealers and Cars to file (EXTRA CREDIT) 7. Exit

Your program will be object oriented (using classes) with the following UML representing the classes (See Chapter 13 for UML Access Specification information):

Dealer + Dealer ( ) // Dont forget to add a new car pointer when you use the Dealer default / constructor + Dealer ( dName:string, dNumber:int) - dealerName: string - dealerNumber: int - carArrayPtr: pointer to a Dynamic Car Array (Note: make sure this is set to nullptr) - numberOfCars: int + setDealerName ( _dealerName:string): void

+ setDealerNumber (_dealerNumber:int ): void +setCarArrayPtr (_carArrayPtr: Car *): void //(This is where you use the new) +setNumberOfCars ( int _numberOfCars): void

+ getDealerName ( ): string + getDealerNumber ( ): int + getCarArrayPtr ( ): Car * +getNumberOfCars: int + friend operator << (out: ostream &, Dealer: _dealer):ostream & //Print the Dealer Name and Number and Blank line for a specific dealer.

Car - VIN:string - make:string - model:string

- year:int - price:double + Car( ) + Car(vVIN:string, vMake:string, vModel:string, vYear:int, vPrice:double) + getVIN( ):string + getMake( ):string + getModel( ):string + getYear( ):int + getPrice( ):double + setVIN(_VIN:string):void

- year:int - price:double + Car( ) + Car(vVIN:string, vMake:string, vModel:string, vYear:int, vPrice:double) + getVIN( ):string + getMake( ):string + getModel( ):string + getYear( ):int + getPrice( ):double + setVIN(_VIN:string):void

Pass the vector of dealers (from main) into the function by reference. Each Dealer will have a name and number followed by the number of cars in the dealership (on separate lines). Then you will read in a Vin, Make, Model, Year and Price for each car (on separate lines). You can assume that the number of cars as well as the Vin, Make, Page 4 of 5 Model, Year and Price will be complete for each car. Each dealer will have a file format as follows:

Dealer Name

Dealer Number

2

Car1 Vin

Car1 Make

Car1 Model

Car1 Year

Car1 Price

Car2 Vin

Car2 Make

Car2 Model

Car2 Year

Car2 Price

Dealer Name

Dealer Number

1

Car1 Vin

Car1 Make

Car1 Model

Car1 Year

Car1 Price

Here is an example file: John Elway Dodge 1 2 VIN123 Dodge Ram 1500 Quad Cab 2017 45186.00 VIN456 Chevrolet Traverse Premier SUV 2017 47868.00 Tesla Cherry Creek 25 1 VIN789 Tesla Model X 2017 105200

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!