/*************************************************** Pretty header comment!!! racecar.cpp by Dustin Luca ***************************************************/ #include using std::cout; using std::endl; #include "racecar.h" Racecar::Racecar( string n, string c, string s ) : Car (n, c) { sponsor = s; color = c; name = n; gearbox = 6; parachuteDeployed = false; } void Racecar::setGearbox(int gears) { gearbox = ( ( gears <= 10 && gears >= 0 ) ? gears : 6 ); } void Racecar::useParachute() { parachuteDeployed = true; } void Racecar::print() const { Car::print(); cout << getName() << " also has " << gearbox << " gears and is sponsored by " << sponsor << ". \n"; if ( parachuteDeployed ) cout << getName() << " has used its parachute." << endl; else cout << getName() << " has not used its parachute." << endl; }