Question: void AddVehicle ( Vehicle v ) { std::vector vehicles; int numberOfVehicles = vehicles.size ( ) ; if ( numberOfVehicles = = capacity ) { cout

void AddVehicle(Vehicle v){
std::vector vehicles;
int numberOfVehicles = vehicles.size();
if (numberOfVehicles == capacity){
cout << "Showroom is full! Cannot add "<< v.GetYearMakeModel()<< endl;
cout << "Vehicles in Full Showroom" << endl;
}
else {
vehicles.push_back(v);
}
}
Showroom.cpp: In function void AddVehicle(Vehicle):
Showroom.cpp:26:29: error: capacity was not declared in this scope
26| if (numberOfVehicles == capacity){
|^~~~~~~~

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!