Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

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

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

MySQL/PHP Database Applications

Authors: Jay Greenspan, Brad Bulger

1st Edition

978-0764535376

More Books

Students also viewed these Databases questions

Question

How was your life influenced by those events?

Answered: 1 week ago

Question

Which of these influenced your life most dramatically?

Answered: 1 week ago