fork download
  1. #include <iostream>
  2. using namespace std;
  3. class Tree
  4. {
  5. public:
  6. float Size;
  7. int height;
  8. void Show(float Size, int height)
  9. {
  10. cout<<" the size is "<<Size<<" the height is"<<height<<endl;
  11. };
  12.  
  13. };
  14.  
  15. class Oak : public Tree {
  16. public:
  17.  
  18. int rings;
  19. void Age(int rings)
  20. {
  21. cout<<" the age is "<<rings<<endl;
  22. }
  23.  
  24. };
  25.  
  26. int main()
  27. {
  28. Tree x;
  29. x.Show(2.2, 5);
  30. Oak y;
  31. y.Show(3.8, 8);
  32. y.Age(6);
  33.  
  34.  
  35. return 0;
  36. }
  37.  
  38.  
  39.  
Success #stdin #stdout 0s 15232KB
stdin
Standard input is empty
stdout
 the size is 2.2 the height is5
 the size is 3.8 the height is8
 the age is 6