#include <iostream>
#include "CShape.cpp"
#define _USE_MATH_DEFINES
#include "math.h"
usingnamespace std;
class CCircle : public CShape
{
protected:
int centerX;
int centerY;
float radius;
void calcArea()
{
area = M_PI * (radius * radius);
}
public:
CCircle(int pCenterX, int pCenterY, float pRadius)
{
centerX = pCenterX;
centerY = pCenterY;
radius = pRadius;
}
float getRadius()
{
return radius;
}
}
As you can see, CShape is the base class that CCircle is suppsoed to inherit from. I'm pretty new to C++, so I could have the file structures wrong (maybe the base is supposed to be in a header file?), if something like that matters.