// association1.h By: Aiman Hanna - ©1993-2006 Aiman Hanna #include enum ava_color { white, black, blue, green, red }; class Engine { public: Engine(double, double ); double GetEngHp( void ); void SetEngHp( double ); double GetEngPrice( void ); void SetEngPrice( double ); private: double horsepower; double price; }; class CarBody { public: CarBody( ava_color, double ); ava_color GetCarBodyColor( void ); void SetCarBodyColor( ava_color ); double GetCarBodyPrice( void ); void SetCarBodyPrice( double ); private: ava_color color; double price; }; class Car { // A car object is viewed as an engine and a car body // The initial price of the car is calculated as 1.5 * ( engine price + body price ) // The color of a car object is the same as the color of the car body of that object, // and the car horsepower is the same as its engine horsepower. public: Car( double hp = 40, ava_color cl = white, double engpr = 5000, double bodpr = 1000 ); double GetCarHorsepower( void ); void SetCarHorsepower( double ); double GetCarPrice( void ); void SetCarPrice( double ); void SetCarColor( ava_color ); char* GetCarColor( void ); void ShowCarInfo( void ); private: Engine eng; CarBody body; double price; }; class AnalyizeCars { public: AnalyizeCars( void ); void FindBetterDeal( Car, Car ); private: double bestprice; double besthp; };