Last active
January 30, 2017 02:19
-
-
Save kalimalrazif/9e400864d1dc2bbf2e12fe817251bd18 to your computer and use it in GitHub Desktop.
Implementacion de la clase animal
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include "animal.h" | |
Animal::Animal() { | |
this->setPatas(0); | |
} | |
void Animal::setPatas(int patas) { | |
// Los animales pueden tener 0 patas pero no un | |
// numero negativo de estas. | |
if (patas < 0) { patas = 0; } | |
this->patas = patas; | |
return; | |
} | |
int Animal::getPatas() { | |
return this->patas; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment