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
Eric Teunis de Boone 78d6fb4e3c Finished Ex8.*
2020-01-06 19:07:30 +01:00

23 lines
518 B
C++

#ifndef CIRCLE_HH
#define CIRCLE_HH
#include "Shape.hh"
#define M_PI 3.14159265358979323846
class Circle: public Shape {
public:
// Constructor, destructor
Circle(int 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:
int _radius ;
} ;
#endif