#include<iostream> #include<cmath> using namespace std; class ProtectedCircle{ protected: float radius; public: void setRadius(float r){ if(0 <= r) radius = r; } public: float getRadius() const{ return radius; } public: float getPerimeter() const{ return (2 * M_PI * radius); } public: float getArea() const{ return (radius * radius) * M_PI; } public: ProtectedCircle(float r = 0){ setRadius(r); } }; class ProtectedCylinder: public ProtectedCircle { private: float height; public: void setHeight(float h){ if(0 <= h) height = h; } public: float getHeight() const{ return height; } public: float getArea() const{ return (((radius * radius) * (2 * M_PI)) + (2 * M_PI * radius * height)); } public: float getVolume() const{ return (M_PI * (radius * radius) * height); } public: ProtectedCylinder(float r = 0, float h = 0): ProtectedCircle(r){ setHeight(h); } }; class PrivateCircle{