匿名用户
1级
2014-04-01 回答
#include
using namespace std;
class dog
{
int age;
float weight;
string name;
public:
dog(string name, int age, float weight)
{
this->name = name;
this->age = age;
this->weight = weight;
}
int getAge()
{
return age;
}
float getWeight()
{
return weight;
}
string getName()
{
return name;
}
void changeName(string name)
{
this->name = name;
}
void setAge(int age)
{
this->age = age;
}
void setWeight(float w)
{
weight = w;
}
void bark()
{
cout<