class Shape
{
public:
virtual double GetArea()=0;
};
class Rectangle : public Shape
{
public:
Rectangle(double h, double w) : height(h), width(w){}
double GetArea(){ return height * width; }
private:
double height;
double width;
};
class Circle : public Shape
{
public:
Circle(double r):radius(r){}
double GetArea(){ return 3.14159 * radius * radius; }
private:
double radius;
};
class Square : public Rectangle
{
public:
Square(double l) : Rectangle(l, l){}
};