Q1. write 4 classess like, body of car, engine of car, tyres of car etc and call these classes in main metod. Note all classess must return some funtionality.
#include <iostream>
using namespace std;
class BodyOfCar{
public:
BodyOfCar(){
cout<<"\n This is the body of the car.";
}
};
class EngineOfCar{
public:
EngineOfCar(){
cout<<"\n This is the engine of the car.";
}
};
class TyresOfCar{
public:
TyresOfCar(){
cout<<"\n This is the tyres of the car.";
}
};
class WindscreenOfCar{
public:
WindscreenOfCar(){
cout<<"\n This is the windscreen of the car.";
}
};
int main(){
BodyOfCar body;
EngineOfCar engine;
TyresOfCar tyres;
WindscreenOfCar windscreen;
return 0;
}
Comments
Leave a comment