An Oil Shop Owner Wants To Find The Volume Of Different Container To Measure Oil. Develop A Java Program To Find Volume Of Container Using The Concept Of Method Overloading Based On The Following Instructions. Save The Project/file As Oil42. A) Class Name

匿名用户 最后更新于 2021-12-01 19:36 计算机类Computing

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

已邀请: