/* Filename: cars.cpp Author: Br. David Carlson Date: July 7, 1998 Revised: July 20, 2000 This file implements the Car class that was set up in cars.h. */ #include "cars.h" /* Given: Nothing (other than the implicit Car object). Task: To print the data contained in this object. Return: Nothing. */ void Car::Print(void) const { ShortString CarName; Product::GetName(CarName); cout << "Type of car: " << CarName << endl << "Year: " << Product::GetYear() << endl << "Price: " << Product::GetPrice() << endl << "Number of doors: " << Doors << endl << "Horsepower: " << Horsepower << endl << endl; } /* Given: Nothing. Task: To look up the number of doors of the implicit Car object. Return: This number of doors in the function name. */ int Car::GetDoors(void) const { return Doors; } /* Given: Nothing. Task: To look up the horsepower of the implicit Car object. Return: This horsepower number in the function name. */ int Car::GetHorsepower(void) const { return Horsepower; }