Advertisement
Guest User

Untitled

a guest
Feb 25th, 2020
82
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.82 KB | None | 0 0
  1. #include <iostream>
  2. using namespace std;
  3.  
  4. typedef enum RACE { Amstaf, York, Labrador };
  5. // lub w ten sposób
  6. typedef enum { Szary, Bury, Czarny } COLOR;
  7.  
  8. class Animal {
  9.  protected:
  10.   float masa;
  11.   int wiek;
  12.  public:
  13.   Animal() { wiek = 0;}
  14.   virtual ~Animal() { cout << "Destruktor Animal" << endl;}
  15.   void Patrz();
  16.   void Oddychaj();
  17.   virtual void RuszajSie() { cout << "Ruszam sie!" << endl; }
  18.   // metody dostępowe do pól
  19.   void Masa(float argMasa) { masa = argMasa; }
  20.   float Masa() const { return masa; }
  21.   int Wiek() const { return wiek; }
  22. };
  23. class HomeDog : public Mammal {
  24.  protected:
  25.    RACE rasa;
  26.    COLOR kolorSiersci;
  27.  public:
  28.    void Aportuj();
  29.    void Szczekaj();
  30.    // metody dostępowe do pól
  31.    RACE Rasa() const { return rasa; }
  32.    COLOR KolorSiersci() const { return kolorSiersci; }
  33. };
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement