#include #include using namespace std; // ******************************************************************* // * Class Car: MY idea of a car, not YOURS. * // * This is to explain classes and objects, and that you * // * don't need to know HOW car works in order to USE the car. * // * i.e., you don't need to know exactly HOW this Class works * // * (car.cpp file shows HOW) in order to know how to USE it. * // ******************************************************************* class Car { public: Car(); // Constructor Car(int _year, string _make, string _model); /* get the current speed of the car */ int getSpeed() const; /* get the current gear of the car */ char getGear() const; /* get the make of the car */ string getMake() const; /* get the model of the car */ string getModel() const; /* get the year of the car */ int getYear() const; /* is the engine running or not? */ bool isRunning() const; /* try to start the car */ void start(); /* try to change the gear of the car */ bool changeGear(char _gear); /* try to accelerate */ bool accelerate(int x); /* try to decelerate (brake) */ bool decelerate(int x); /* try to turn the engine off */ void turnOff(); /* print the current status of the car to the screen */ void printStatus() const; private: bool running; char gear; int speed; string make; string model; int year; };