add solution of lab01
This commit is contained in:
28
labs/classes/Animal.h
Normal file
28
labs/classes/Animal.h
Normal file
@@ -0,0 +1,28 @@
|
||||
#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_;
|
||||
};
|
||||
Reference in New Issue
Block a user