Now a “cylinder” class
This looks very similar:
class cylinder {
protected:
float radius;
float height;
public:
float GetVolume();
float GetSurface();
cylinder (float,float);
};
Here you group not only variables, but also access methods
And this is new, a “constructor”, which will build an object of class “cylinder” for you.
Previous slide
Next slide
Back to first slide
View graphic version