Question: THIS IS FOR C + + NOT Normal C I NEED HELPING UNDERSTAN DO NOT USE I need help understanding how to use as may
THIS IS FOR C NOT Normal C I NEED HELPING UNDERSTAN DO NOT USE I need help understanding how to use as may be used. thank you.
I need help understanding more about constructors and the use of classes for C Thank you ahead of time.
Class Cylinder
private data members:
double radius the radius of the cylinder
double height the height of the cylinder
public member functions:
Function "setDim accepts both the radius and height as input parameters. The input
parameters are used to update the internal data members of the objectclass
Function "getSurfaceArea which returns the surface area of the cylinder as a double type. The
surface area of the cylinder is given by
Function "getVolume which returns the volume of the cylinder as double type. The volume of
the cylinder is given by
Function "printAll which is used to print the radius, height, surface area, and volume of the
cylinder. This function should utilize the previous functions that were written to get the surface
area and volume.
Default constructor which initializes the radius and height to zero.
Constructor which accepts two parameters for the radius and height.
Create a main program to test the class by creating two cylinder objects. Use the constructor
to initialize one of the objects and use the setDim function to initialize the other object.
Demonstrate the class is working correctly by assigning values to each object and printing their
surface area and volume.
Step by Step Solution
There are 3 Steps involved in it
1 Expert Approved Answer
Step: 1 Unlock
Question Has Been Solved by an Expert!
Get step-by-step solutions from verified subject matter experts
Step: 2 Unlock
Step: 3 Unlock
