Question: Design and implement a class that will simulate a cylinder; call the class Cylinder. Name your instance variables radius and height. Have functions called calculateSurfaceArea

Design and implement a class that will simulate a cylinder; call the class Cylinder. Name your instance variables radius and height. Have functions called calculateSurfaceArea and calculateVolume. Implement Accessors and Mutators for all instance variables of the class. Have two constructors; the first will be the default constructor (set all instance variables to 1) and the second will be a constructor that will pass values to set the instance variables to the object. Develop a function printCylinderInfo which will print a four line description of the cylinder. It will output a neat formatted string showing the radius and height of the object as well as the objects surface area and volume. Use two decimal points of accuracy with the printCylinderInfo method. You may hard code the data for three Cylinders (you'll need radius and height for each). Create a Cylinder object for each, and use the functions of the Cylinder class to print out the height, radius, volume, and surface area of each cylinder. Use the data in the image. Design and implement a class that will simulate a cylinder; call the

myCylinder01 7.3 3.1 myCylinder02 myCylinder03 2 4 radius height

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!