Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <iostream>
- using namespace std;
- typedef enum RACE { Amstaf, York, Labrador };
- // lub w ten sposób
- typedef enum { Szary, Bury, Czarny } COLOR;
- class Animal {
- protected:
- float masa;
- int wiek;
- public:
- Animal() { wiek = 0;}
- virtual ~Animal() { cout << "Destruktor Animal" << endl;}
- void Patrz();
- void Oddychaj();
- virtual void RuszajSie() { cout << "Ruszam sie!" << endl; }
- // metody dostępowe do pól
- void Masa(float argMasa) { masa = argMasa; }
- float Masa() const { return masa; }
- int Wiek() const { return wiek; }
- };
- class HomeDog : public Mammal {
- protected:
- RACE rasa;
- COLOR kolorSiersci;
- public:
- void Aportuj();
- void Szczekaj();
- // metody dostępowe do pól
- RACE Rasa() const { return rasa; }
- COLOR KolorSiersci() const { return kolorSiersci; }
- };
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement