diff options
Sem 14
1 files changed, 19 insertions, 0 deletions
| -rw-r--r-- | Sem. 14/Farm/source.cpp | 19 |
diff --git a/Sem. 14/Farm/source.cpp b/Sem. 14/Farm/source.cpp new file mode 100644 index 0000000..e72e7ca --- /dev/null +++ b/Sem. 14/Farm/source.cpp @@ -0,0 +1,19 @@ +#include <iostream> +#include "../Farm/Collection/Farm.h" + +int main() +{ + Farm myFarm; + + while (1) + { + size_t animalId; + std::cin >> animalId; + bool result = myFarm.addAnimal((Animal::AnimalType)animalId); + + if (result) + std::cout << "Added animal of type: " << myFarm.getTypeByIndex(myFarm.getCount() - 1) << std::endl; + else + std::cout << "Invalid animal type" << std::endl; + } +}
\ No newline at end of file |
