#include using namespace std; class Vehicle { public: void Run() { cout << "Vehicle is running" << endl; } void Stop() { cout << "Vehicle stops" << endl; } }; class Bicycle : public Vehicle { public: void Run() { cout << "Bicycle is running" << endl; } void Stop() { cout << "Bicycle stops" << endl; } }; class Motorcar : public Vehicle { public: void Run() { cout << "Motorcar is running" << endl; } void Stop() { cout << "Motorcar stops" << endl; } }; class Motorcycle : public Bicycle, public Motorcar { public: void Run() { cout << "Motorcycle is running" << endl; } void Stop() { cout << "Motorcycle stops" << endl; } }; int main() { Vehicle v; v.Run(); v.Stop(); Bicycle b; b.Run(); b.Stop(); Motorcar m; m.Run(); m.Stop(); Motorcycle mc; mc.Run(); mc.Stop(); Vehicle* vp = &v; vp->Run(); vp->Stop(); vp = &b; vp->Run(); vp->Stop(); vp = &m; vp->Run(); vp->Stop(); vp = &mc; vp->Run(); vp->Stop(); return 0; }