// inherit1.h By: Aiman Hanna - ©1993-2006 Aiman Hanna #ifndef INHERIT1_H #define INHERIT1_H #include #include class Vehicle { public: Vehicle(); Vehicle(double, int); // overloaded constructor void setPrice(double); double getPrice(); void setMaxSpeed(int); int getMaxSpeed(); void showInfo(); 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(); Car(double, int, char*); void setModel(char*); char* getModel(); void showInfo(); ~Car(); 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