#include "car.h" #include #include using namespace std; Car::Car(int max, string mm) { Speed = 0; Max_speed = max; Make_model = mm; cout << Make_model << " is created w/ max speed of " << Max_speed << endl; } Car::~Car() { Speed = 0; cout << Make_model << " is destroyed" << endl; } void Car::Accelerate(int increment) { Speed += increment; if (Speed > Max_speed) Speed = Max_speed; } void Car::Decelerate(int decrement) { Speed -= decrement; if (Speed < 0) Speed = 0; } void Car::Drive(void) { cout << Make_model << " is driving at " << Speed << endl; }