An oil shop ownerwants to find the volume of different container to measure oil.Develop a java program to find volume of container using theconcept of method overloadingbased on the following instructions. Save the project/file asoil42.
A) Classname: Container
Member Methods:
–tocalculate and return volume of cone
volume = length *length * length
–tocalculate and return volume of cylinder
volume = 3.14 * (radius + height )
– to calculate andreturn volume of pyramid
volume = A * B / C
B) Controllingclass: oil42
–To createan object of Container
–Todisplay volume of cone
–Todisplay volume of cylinder
–Todisplay volume of pyramid
没有找到相关结果