1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64
|
class AutoVehicleType
{
public:
AutoVehicleType ();
AutoVehicleType (string brand, int year, string country, int hp, string id, VehicleKind k,
string amn[], int num_amn);
void setAutoInfo(string brand, int year, string country, int hp, string id, VehicleKind vk,
string amn[], int num_amn);
void setAutoBrand(string brand);
void setYearMade(int yr);
void setCountryMade(string country);
void setHoursePower(int hp);
void setNumPlate(string id);
void setAutoType(VehicleKind vt);
string getAutoBrand();
int getYearMade();
string getCountryMade();
int getHoursePower();
string getNumPlate();
VehicleKind getAutoType();
void printVehicle();
void printVehicleInfo();
void printAllVehiclesMadeBy(AutoVehicleType[], int noOfVehicles, string brand);
bool isMadeByCompany(string companyName);
bool HaveIdenticalAmenities(AutoVehicleType otherVehicles);
private:
string autoBrand;
int yearMade;
string countryMade;
int hoursePower;
string numPlate;
VehicleKind autoType;
int numOfAmenities;
string amenities[4];
int count;
};
void printVehiclesWithIdenticalAmenities(AutoVehicleType Vehicles[], int noOfVehicles)
{
AutoVehicleType a;
int Amen = 0;
a.numOfAmenities = Amen;
int i;
for (i = 0; i < noOfVehicles; i++)
{
for (int j = noOfVehicles; j > 0; j--)
{
if (Vehicles[i].Amen == Vehicles[j].Amen )
{
cout<<"Vehicles "<<Vehicles[i].getNumPlate()<<" and "<<Vehicles[j].getNumPlate()
<<" Have Identical set of Amenites";
}
}
}
}
|