// inherit10.h By: Aiman Hanna - ©1993-2002 Aiman Hanna #ifndef INHERIT10_H #define INHERIT10_H #include enum avl_colors { red, black, white, green }; enum yes_no { yes, no }; class Vehicle { public: Vehicle( void ); Vehicle( avl_colors, int ); // Step #5 : Declare the function as virtual in the abstract class. virtual void ShowInfo( void ) = 0; // This is enough to disallow // declaring any object from // this class // Is it a base class now? Why? int GetNumCyl( void ); char* GetColor( void ); private: int numcyl; avl_colors color; }; class Bus: public Vehicle { public: Bus( avl_colors, int, yes_no ); void ShowInfo( void ); yes_no HasBar ( void ); private: yes_no barexist; }; class Van: public Bus { public: Van( avl_colors, int, yes_no ); // last argument here is for turbo void ShowInfo( void ); yes_no IsTurbo( void ); private: yes_no turbo; }; #endif