1
0
Fork 0
This repository has been archived on 2021-11-03. You can view files and clone it, but cannot push or open issues or pull requests.
uni-m.cds-adv-prog/ex8.3/Circle.hh

23 lines
526 B
C++

#ifndef CIRCLE_HH
#define CIRCLE_HH
#include "Shape.hh"
#define M_PI 3.14159265358979323846
class Circle: public Shape {
public:
// Constructor, destructor
Circle( double radius ) : _radius(radius) {} ;
virtual ~Circle() {} ;
// Implementation of abstract interface
virtual double surface() const { return M_PI * _radius * _radius ; }
virtual double circumference() const { return 2 * M_PI * _radius ; }
virtual const char* shapeName() const { return "Circle"; }
private:
double _radius ;
} ;
#endif