#ifndef SUV_H #define SUV_H #include "Automobile.h" using namespace std; // The SUV class represents a SUV which allows more than the typical number of passengers class SUV : public Automobile { private: int passengers; //SUV special attribute public: // Default constructor sets a minimum of 4 passengers SUV() : Automobile() { passengers = 4; } // Constructor #2 ensures number of passengers is 4 or more SUV(string SUVMake, int SUVModel, int SUVMileage, double SUVPrice, int SUVpassengers) : Automobile(SUVMake, SUVModel, SUVMileage, SUVPrice) { //could improve the checking of number of passengers to ensure not too big if (SUVpassengers < 4) passengers = 4; else passengers = SUVpassengers; } //destructor is meaningless in this example but provided to illustrate the flow of control ~SUV() { } // Accessor for passengers attribute int getPassengers() { return passengers; } //void displayVehicleInfo() virtual void displayVehicleInfo() const override { cout << fixed << showpoint << setprecision(2); cout << "Model year " << model << endl; cout << "Make " << make << endl; cout << "can carry " << passengers << " passengers" << endl; cout << "mileage " << mileage << " miles " << endl; cout << "Price: $" << price << endl; } }; //end class SUV #endif