// inherit6.h By: Aiman Hanna - ©1993-2006 Aiman Hanna #ifndef INHERIT6_H #define INHERIT6_H #include #include class Vehicle { public: Vehicle(double, int); // There is no default constructor now void setPrice(double); double getPrice(); void setMaxSpeed(int); int getMaxSpeed(); void showInfo(); protected: double price; int maxSpeed; }; // Derived classes from Vehicle class Bus : public Vehicle { public: Bus(); Bus(double, int, double); void setCargoCapacity(double); double getCargoCapacity(); void showInfo(); private: double cargoCapacity; }; class Car : public Vehicle { public: Car(double, int, char*); // There is no default constructor now void setModel(char*); char* getModel(); void showInfo(); ~Car(); protected: char* model; }; // Just a simple enum type enum toptype {hardtop, softtop}; // Derived classes from Car, which is derived from Vehicle class Convertible : public Car { public: Convertible(); Convertible(double, int, char*, toptype); void setTopType(toptype); char* getTopType(); void showInfo(); private: toptype top; }; #endif