Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Language: C++ In my main file (main.cpp), the code includes int main(){ Vehicle vehicles[] = { Vehicle(Toyota, Camry, 2010, 20000, 31000), ......}; Showroom showroom (Primary

Language: C++

In my main file (main.cpp), the code includes

int main(){

Vehicle vehicles[] = { Vehicle("Toyota", "Camry", 2010, 20000, 31000), ......};

Showroom showroom ("Primary" , 3);

showroom.AddVehicle(&vehicles[0]); showroom.AddVehicle(&vehicles[1]);

}

I already wrote the code for Vehicle.cpp and vehicle.h, now i need help writing the Showroom.cpp and showroom.h. The Showroom class has to store an array of Vehicle objects using dynamic memory allocation and needs to contain variables for the name of the showroom, a pointer to the array of vehicles, a maximum capacity of array, and count of how many vehicles it currently has. It also needs functions "void AddVehicle(const Vehicle *v);" to store vehicle in first available spot and "void ShowInventory() const;" to show the name and all of the vehicles in it. The accessors it should have are "const Vehicle *GetVehicleList() const;" , "unsigned int GetCapacity() const;" , "unsigned int GetCount() const;" , and "const char * GetName() const;"

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

Database Processing

Authors: David M. Kroenke, David Auer

11th Edition

B003Y7CIBU, 978-0132302678

More Books

Students also viewed these Databases questions

Question

When would you use one approach, and when would you use another?

Answered: 1 week ago