// @topic T52025 11/27/2012 -- Inheritance and Polymorphism
// @brief class Circle inherits from Shape
#ifndef _CIRCLE_H_INCLUDED_
#define _CIRCLE_H_INCLUDED_
class Circle : public Shape {
int m_radius;
public:
// constructors
Circle( int radius ) //: Shape( SHAPE_TYPE_CIRCLE )
:
m_radius( radius )
{
}
// operations
virtual void draw() {
std::cout << area() << " ";
std::cout << "circle\n";
}// draw
virtual double area() {
return PI * m_radius * m_radius;
}//area
};//class Circle
#endif // _CIRCLE_H_INCLUDED_