Home > Back-end >  C programming for the teacher to help programming
C programming for the teacher to help programming

Time:11-14

As shown in the figure below the of all kinds of relations, programming the output of various kinds of information for the following
1. The traffic tools (Vehicle) :
A) data members - weight (weight);
B) definition can be able to modify the weight function SetWeight ()
2. Motor vehicles (Car) : data members - air emissions (aird);
3. The boating class (a Boat) : data members - displacement (tonnage);
4. The amphibious vehicle class (AmphibianCar) :
A) data members - displacement (AmphibianCar)
B) define able to display the profile of the member functions of amphibious vehicle ShowMe ()
C) to define member functions can display amphibious car ShowMembers ()
5. In the main function, define an amphibious car ACar1,1.35 (4200); Output amphibious car all relevant information; Change and its original weight to 3 tons, and the output,

Input and output sample:
Load transportation class constructor (Vehicle)
Load the Car class constructor (Car)
Load the boating class constructor (a Boat)
Load the amphibious vehicle class constructor (AmphibianCar)
I'm amphibious car! My information is as follows:
Weight=4 tons of air displacement=200 cc displacement=1.35 tons of
Reset the weight
Weight=3 tons of air displacement=200 cc displacement=1.35 tons of
  • Related