Using our new class
float cylinder::GetVolume(){
return ( PI*radius*radius * height );
float cylinder::GetSurface() {
return ( 2*PI*radius*height + 2*PI*radius*radius);
cylinder::cylinder(float r, float h){
cout << "volume is " << volume << endl;
Here we construct a new cylinder with radius 2 and height 1.
Then we ask the cylinder to please calculate its volume and return it to us
BTW, the output is: volume is 12.5664