#ifndef SPORTCAR_H #define SPORTCAR_H #include "Automobile.h" #include "SportCar.h" using namespace std; class SportCar:public Car //this is a sub-sub class of Automobile { private: int maxSpeedMPH; public: SportCar() //default constructor { maxSpeedMPH = 200; doors = 2; } //constructor calls its parent constructor! Who is the parent of sportCar class? SportCar(string carMake, int carModel, int carMileage, double carPrice, int carDoors, int maxSp) : Car(carMake, carModel, carMileage, carPrice, carDoors) { maxSpeedMPH = maxSp; doors = 2; } //accessor function int getMaxSpeed() { return maxSpeedMPH; } //overridden function does not repeat the code in its parent class Car //instead it explicitly invokes the overriden function in the Car class //void displayVehicleInfo() void displayVehicleInfo() const override { Car::displayVehicleInfo(); //call the parent class overridden function! cout << "Maximum production speed is " << maxSpeedMPH << " mph" << endl; } ~SportCar() {} }; #endif // SPORTCAR_H