Files
CSCI-1200/labs/classes/Animal.h
2025-01-20 20:23:49 -05:00

29 lines
694 B
C++

#include <string>
class Animal {
public:
Animal(const std::string &name);
std::string getName() const;
void setWeight(double new_weight);
double getWeight() const;
void setCanSurviveOnLand(bool can_land);
bool canSurviveOnLand() const;
void setCanSurviveInWater(bool can_water);
bool canSurviveInWater() const;
void setEatsMeat(bool meat);
bool eatsMeat() const;
void setEatsPlants(bool plants);
bool eatsPlants() const;
bool isOmnivore() const;
bool isAmphibious() const;
private:
std::string name_;
double weight_;
bool can_survive_on_land_;
bool can_survive_in_water_;
bool eats_meat_;
bool eats_plants_;
};