/*************************************************** Pretty header comment!!! car.cpp by Dustin Luca ***************************************************/ #include using std::cout; using std::endl; #include "car.h" Car::Car(string n2, string c2) { name = n2; color = c2; setMaxSpeed(95); setEngineValves(4); } void Car::setMaxSpeed(int s) { maxSpeed = ( ( s >= 0 && s < 250) ? s : 40); } void Car::setEngineValves(int v) { engineValves = ( ( v >= 0 && v < 50 ) ? v : 4); } int Car::getMaxSpeed() const { return maxSpeed; } int Car::getEngineValves() const { return engineValves; } string Car::getName() const { return name; } string Car::getColor() const { return color; } void Car::print() const { cout << "Car: " << getName() << " is " << getColor() << " and has a " << engineValves << "-valve engine. The MAX SPEED is " << maxSpeed << " mph. " << endl; }