Question: #include #include using namespace std; class Showroom { string name; vector < Vehicle > vehicles; int capacity; public: Showroom ( ) { string name =

#include
#include
using namespace std;
class Showroom {
string name;
vector < Vehicle > vehicles;
int capacity;
public:
Showroom(){
string name = "Unnamed Showroom";
}
Showroom(string name, unsigned int capacity){
this->name = name;
this->capacity = capacity;
}
vector < Vehicle > GetVehicleList(){
return vehicles;
}
void AddVehicle(Vehicle v){
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);
}
}
void ShowInventory(){
for (int i =0; i < vehicles.size(); i++){
vehicles[i].Display();
}
}
float GetInventoryValue(){
float sum =0;
for (int i =0; i < vehicles.size(); i++){
sum += vehicles.at(i).GetPrice();
}
return sum;
}
};
In file included from main.cpp:2:
Showroom.h: In member function void Showroom::ShowInventory():
Showroom.h:34:27: warning: comparison of integer expressions of different signedness: int and std::vector::size_type{aka long unsigned int}[-Wsign-compare]
34| for (int i =0; i < vehicles.size(); i++){
| ~~^~~~~~~~~~~~~~~~~
Showroom.h: In member function float Showroom::GetInventoryValue():
Showroom.h:40:27: warning: comparison of integer expressions of different signedness: int and std::vector::size_type{aka long unsigned int}[-Wsign-compare]
40| for (int i =0; i < vehicles.size(); i++){
| ~~^~~~~~~~~~~~~~~~~

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!