Guest
Public paste!

Untitled

By: a guest | Mar 21st, 2010 | Syntax: None | Size: 1.40 KB | Hits: 52 | Expires: Never
This paste has a previous version, view the difference. Copy text to clipboard
  1. #include <iostream>
  2. using namespace std;
  3.  
  4. class tier
  5. {
  6. protected:
  7.        
  8.        int alter;
  9.        int gewicht;
  10.  
  11. public:
  12.        
  13.        void fressen(){cout <<"fressen"<<endl;}
  14.        void daten(){cout <<"alter = "<<alter <<" "<<"gewicht = "<<gewicht<< endl;}
  15.        
  16.        
  17.          
  18. };
  19.  
  20. class hund : public tier
  21. {
  22. private:
  23.            
  24.  
  25. public:
  26.        
  27.        hund(int alt, int gew)
  28.        {
  29.          alter = alt;
  30.          gewicht = gew;    
  31.        }  
  32.        
  33.        void bellen(){cout <<"wau wau "<<endl;}  
  34.  
  35.      
  36. };
  37.  
  38. class vogel : public tier
  39. {
  40. private:
  41.        
  42.        
  43.        
  44. public:
  45.        vogel(int alt, int gew)
  46.        {
  47.           alter = alt;
  48.           gewicht = gew;
  49.                  
  50.                  }
  51.                  
  52.           void fliegen(){cout <<"flatter flatter "<< endl;}
  53.      
  54.       };
  55.      
  56.  
  57.      
  58. class dino : public tier
  59. {
  60. private:
  61.        
  62. public:
  63.        dino(int alt, int gew)
  64.        {
  65.         alter = alt;
  66.         gewicht = gew;
  67.    
  68.                 }
  69.  
  70.          
  71.       void bruellen(){cout <<"ruuaaaaarrr "<< endl;}
  72.      
  73.       };
  74.  
  75.  
  76. int main()
  77. {
  78.    
  79.     hund umbra(5, 66);
  80.     umbra.daten();
  81.     umbra.bellen();
  82.     cout << endl;
  83.     vogel arax(2, 3);
  84.     arax.daten();
  85.     arax.fliegen();
  86.     dino bambam(10, 20);
  87.     dino.daten();
  88.     dino.bruellen();
  89.    
  90.    
  91.     getchar();
  92. return 0;    
  93. }