#include <iostream>

using namespace std;

class Engine {
  public:
    Engine(int cyl = 4, int cap = 2000, int pow = 150);
    bool start();
    bool stop();

  private:
    bool status;
    int fuel;
    int cylinders;
    int capacity;
    int power;
};

class Transmission {
  public:
    Transmission(int g = 6);

  private:
    int gears;
};


class Vehicle {
  public:
    Vehicle(int w = 0, int l = 0, int h = 0);
    virtual bool start(); 
    virtual bool stop();
    virtual int turn(int dir);
    
  protected:
    Engine engine;
    Transmission transmission;

  private:
    int weight;
    int length;
    int height;
};


class Car : public Vehicle {
  public:
    Car(int w = 4);
    bool start();
    bool stop();

  private:
    int turn(int dir);
    int lights;
    int wheels;
};


class Truck : public Vehicle {
  public:
    Truck(int w = 4);
    bool start();
    bool stop();

  private:
    int wheels;
};


class Bike : public Vehicle {
  public:
    Bike(int w = 2);
    using Vehicle::start;
    using Vehicle::stop;

  protected:
    using Vehicle::engine;

  private:
    int wheels;
};


class Tank : public Vehicle {
  public:
    Tank(int g = 120);

  private:
    int gun;
};

Engine::Engine(int cyl, int cap, int pow) {
    this->status = true;
    this->cylinders = cyl;
    this->capacity = cap;
    this->power = pow;
}

bool Engine::start() {
    cout << "Engine start" << endl;
    return this->status;
}

bool Engine::stop() {
    cout << "Engine stop" << endl;
    return true;
}

Transmission::Transmission(int g) {
    this->gears = g;
}

Vehicle::Vehicle(int w, int l, int h) {
    this->weight = w;
    this->length = l;
    this->height = h;
}

bool Vehicle::start() {
    cout << "Vehicle start" << endl;
    return engine.start();
}

bool Vehicle::stop() {
    cout << "Vehicle stop" << endl;
    return engine.stop();
}

int Vehicle::turn(int dir) {
    cout << "Vehicle turns " << (dir ? "right" : "left") << endl;    
    return 0;
}

Car::Car(int w) {
    this->wheels = w;
}

bool Car::start() {
    cout << "Car start" << endl;
    if (Vehicle::start()) {
        this->lights = 1;
        return true;
    } else
        return false;
}

bool Car::stop() {
    cout << "Car stop" << endl;    
    this->lights = 0;
    return Vehicle::stop();
}

int Car::turn(int dir) {
    cout << "Car turns " << (dir ? "right" : "left") << endl;    
    return 0;
}

Truck::Truck(int w) {
    this->wheels = w;
}

bool Truck::start() {
    cout << "Truck start" << endl;
    return false;
}

bool Truck::stop() {
    cout << "Truck stop" << endl;    
    return false;
}


bool run(Vehicle &vehicle) {
    vehicle.start();
    vehicle.turn(0);
    vehicle.turn(1);
    vehicle.stop();
    
    return false;
}

int main() {
    Car c;
    Truck t;

    run(c);
    
    cout  << endl;
    
    run(t);
    
    return 0;
}


