这道c++编程题怎么做?
2个回答
展开全部
class Point
{
private:
int x;
int y;
public:
Point(int x,int y);
void SetP(int x,int y);
int getX();
int getY();
};
Point::Point(int x,int y)
{
x = x;
y = y;
}
void Point::SetP(int x,int y)
{
x = x;
y = y;
}
int Point::getX()
{
return x;
}
int Point::getY()
{
return y;
}
class Circle
{
private:
int radius;
Point pt;
public:
Circle(Point pt,int r);
float getArea();
void show();
void SetCC(Point pt,int r);
};
Circle::Circle(Point pt,int r)
{
pt.x = pt.x;
pt.y = pt.y;
radius = r;
}
float Circle::getArea()
{
return PI * radius * radius;
}
void Circle::SetCC(Point pt,int r)
{
pt.x = pt.x;
pt.y = pt.y;
radius = r;
}
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询