JAVA BASIC PROBLEM

 

Problem 3: Every cylinder has a base and height, where the base is a circle. Design the class Cylinder that can capture the properties of a cylinder and perform the usual operations on a cylinder. Derive this class from the class Circle designed in Problem 2. Operations that can be performed on a cylinder are as follows:

a) setHeight to set the height,

b) setBaseRadius to set the radius of the base,

c) setBaseCenter to set the center of the base.

d) calcVolume to calculate the volume,

e) calcSurface to calculate the surface area,

f) printCylinder to print the Cylinder’s diameter and height, and g) toString to return a string containing the cylinder’s base (i.e., center and radius) and height. Also, write a test program to test various operations on a cylinder.

© 2020 customphdthesis.com. All Rights Reserved. | Disclaimer: for assistance purposes only. These custom papers should be used with proper reference.