Question: Having issues with C++ pointers and classes would appreciate some help This is an example of the expected use: Showroom showroom(Primary Showroom, 3); showroom.AddVehicle(&vehicles[0]); showroom.AddVehicle(&vehicles[1]);

 Having issues with C++ pointers and classes would appreciate some help

Having issues with C++ pointers and classes would appreciate some help

This is an example of the expected use:

Showroom showroom("Primary Showroom", 3); showroom.AddVehicle(&vehicles[0]); showroom.AddVehicle(&vehicles[1]);

Showroom The Showroom class is a bit more sophisticated. Its purpose is to store an array of Vehicle objects. Each Showroom that you create could have a different number of Vehicles, so you will have to use dynamic memory allocation in this case. Your Showroom should contain variables for the following: The name of the Showroom A pointer to the array of Vehicles, and because pointers don't have any addition info on their own... A maximum capacity of the array A count of how many Vehicles you currently have In addition, you should create the following functions (plus the special functions-a copy constructor, assignment operator, and destructor): // Store a Vehicle in the first available spot void AddVehicle (const Vehicle *v); // Show the name of this object and all of its vehicles void ShowInventory() const; // Accessors const Vehicle *GetVehicleList() const; unsigned int GetCapacity() const; unsigned int GetCount () const; const char GetName() 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!