(1)
#include <iostream>
using namespace std;
class Animal{
private:
float age,height,weight;
public:
Animal(float age,float height,float weight){
this->age = age;
this->height = height;
this->weight = weight;
}
void eat();
void do_sports();
void sleep();
void print_info();
};
void Animal::eat(){
weight+=1;
}
void Animal::do_sports(){
height+=1;
}
void Animal::sleep(){
age+=0.5;
weight+=0.5;
height+=0.5;
}
void Animal::print_info(){
cout<<"age: "<<age<<"weight: "<<weight<<"height: "<<height;
}
int main(){
Animal panda(17,180,120);
panda.eat();
panda.sleep();
panda.eat();
panda.do_sports();
panda.print_info();
}