1class MichelinWheel 2{ 3public: 4 MichelinWheel(int q,...); 5int getLoad( ); 6private: 7int qulity; 8 .... 9};10 MichelinWheel::MichelinWheel( int q,....)11:quilty(q)12{}13int MichelinWheel::getLoad( )14{15//经过一些列因素和公式得出该轮胎的负载能力16 ...17return load;18}1920class BenzCar21{22public:23int getDistance( )24private:25 MichelinWheel* wheel26int speed27};28 BenzCar::BenzCar(MichelinWheel* w)29{30 wheel=w;31}32BenzCar::getDistance ( )33{34 carSpeed=speed;35//经过一些列因素和公式得出汽车在某个速度的制动距离36 ...37return distance38 } 1class MichelinWheel 2{ 3public: 4 MichelinWheel(int q,...); 5int getFriction( ); 6private: 7int qulity; 8 .... 9};10 MichelinWheel::MichelinWheel( int q,....)11:quilty(q)12{}13int MichelinWheel::getFriction( )14{15//经过一些列因素和公式得出该轮胎的摩擦力16 ...17return friction;18}1920class Car21{22 vritual int getDistance( )=0;23};2425class BenzCar:public Car26{27public:28int getDistance( )29private:30 MichelinWheel* wheel31int speed32};33 BenzCar::BenzCar(MichelinWheel* w)34{35 wheel=w;36}37BenzCar::getDistance ( )38{39 carSpeed=speed;40//经过一些列因素和公式得出汽车在某个速度的制动距离41 ...42return distance43 } 1class Wheel 2{ 3public: 4virtualint getFriction( )=0; 5}; 6 7class MichelinWheel:public Wheel 8{ 9public:10 MichelinWheel(int q,...);11int getFriction( );12private:13int qulity;14 ....15};16 MichelinWheel::MichelinWheel( int q,....)17:quilty(q)18{}19int MichelinWheel::getFriction( )20{21//经过一些列因素和公式得出该轮胎的摩擦力22 ...23return friction ;24}2526class Car27{28 vritual int getDistance( )=0;29};3031class BenzCar:public Car32{33public:34int getDistance( )35private:36 Wheel* wheel37int speed38};39 BenzCar::BenzCar(Wheel* w)40{41 wheel=w;42}43BenzCar::getDistance ( )44{45 carSpeed=speed;46//经过一些列因素和公式得出汽车在某个速度的制动距离47 ...48return distance49 }