Advertisement
L3peha

Untitled

Feb 19th, 2020
115
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.38 KB | None | 0 0
  1. class ZooKeeper
  2. {
  3. public:
  4. ZooKeeper();
  5. void handleAnimal(Animal* a);
  6. int getDangerousCount();
  7. private:
  8. int Dangerous;
  9. };
  10.  
  11. ZooKeeper::ZooKeeper()
  12. {
  13. this->Dangerous = 0;
  14. }
  15.  
  16. void ZooKeeper::handleAnimal(Animal* a)
  17. {
  18. if (a->isDangerous() == 1)
  19. {
  20. this->Dangerous = this->Dangerous + 1;
  21. }
  22. }
  23.  
  24. int ZooKeeper::getDangerousCount()
  25. {
  26. return this->Dangerous;
  27. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement