Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- class ZooKeeper
- {
- public:
- ZooKeeper();
- void handleAnimal(Animal* a);
- int getDangerousCount();
- private:
- int Dangerous;
- };
- ZooKeeper::ZooKeeper()
- {
- this->Dangerous = 0;
- }
- void ZooKeeper::handleAnimal(Animal* a)
- {
- if (a->isDangerous() == 1)
- {
- this->Dangerous = this->Dangerous + 1;
- }
- }
- int ZooKeeper::getDangerousCount()
- {
- return this->Dangerous;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement