Question: Pleae include both cpp and h files and I would be thankful if you could show the output you got, please :) And main. cpp:

Pleae include both cpp and h files and I would be thankful if you could show the output you got, please :)

Pleae include both cpp and h files and I would be thankful

if you could show the output you got, please :) And main.

And main. cpp:

#include "Vehicle.h" #include "Showroom.h" #include "Dealership.h" #include #include #include #include using namespace std;

void TestOne(Vehicle *v); void TestTwo(Vehicle *v);

int main() { // Initialize some data. It's hard-coded here, but this data could come from a file, database, etc Vehicle vehicles[] = { Vehicle("Ford", "Mustang", 1973, 9500, 113000), Vehicle("Mazda", "CX-5", 2017, 24150, 5900), Vehicle("Dodge", "Charger", 2016, 18955, 9018), Vehicle("Telsa", "Model S", 2018, 74500, 31), Vehicle("Toyota", "Prius", 2015, 17819, 22987), Vehicle("Nissan", "Leaf", 2016, 12999, 16889), Vehicle("Chevrolet", "Volt", 2015, 16994, 12558), };

int testNum; cin >> testNum; if (testNum == 1) TestOne(vehicles); else if (testNum == 2) TestTwo(vehicles);

return 0; }

void TestOne(Vehicle *vehicles) { // Showrooms to store the vehicles Showroom showroom("Primary Showroom", 3); showroom.AddVehicle(&vehicles[0]); showroom.AddVehicle(&vehicles[1]); //showroom.AddVehicle(&vehicles[2]); Showroom secondary("Fuel-Efficient Showroom", 4); secondary.AddVehicle(&vehicles[3]); secondary.AddVehicle(&vehicles[4]); secondary.AddVehicle(&vehicles[5]); secondary.AddVehicle(&vehicles[6]);

// A "parent" object to store the Showrooms Dealership dealership("COP3503 Vehicle Emporium", 2); dealership.AddShowroom(&showroom); dealership.AddShowroom(&secondary);

dealership.ShowInventory(); }

void TestTwo(Vehicle *vehicles) { // Showrooms to store the vehicles Showroom showroom("Primary Showroom", 3); showroom.AddVehicle(&vehicles[0]); showroom.AddVehicle(&vehicles[1]); Showroom secondary("Fuel-Efficient Showroom", 4);

secondary.AddVehicle(&vehicles[4]); secondary.AddVehicle(&vehicles[5]); Showroom third("Fuel-Efficient Showroom", 4); third.AddVehicle(&vehicles[3]); // A "parent" object to store the Showrooms Dealership dealership("COP3503 Vehicle Emporium", 3); dealership.AddShowroom(&showroom); dealership.AddShowroom(&secondary); dealership.AddShowroom(&third);

cout

cout

Description This program will represent a hypothetical car dealership, which consists of showrooms that contain the vehicles for sale. To that end, there are three classes you will be writing: Vehicle Showroom . Dealership For this assignment, main.cpp will be provided for you, so you don't have to worry about the structure of the program. Instead, you can focus solely on the structure of the classes and their interactions Vehicle The Vehicle class is the basic container of this assignment. You will need to store the following data: . The make of the vehicle (such as Mazda, Toyota, etc) . The model of the vehicle (such as Mustang, Model S, F-150, etc) The year The price . How many miles does the vehicle have on it? In addition to a constructor which takes in the necessary information, you will also need the following functions defined. If you are using dynamic memory in your class, you will also want to define a destructor, in which you will clean up (delete) any memory which was allocated by the class. Print all the information on a single line void Display() const; // Return a string in the form of "1970 Ford Mustang" string GetYearMakeModel() const; // How much to buy this? float GetPrice() const

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!