Question: Define the following methods: calcVol ( ) has two double parameters as a cone's radius and height. The method returns the cone's volume as a
Define the following methods: calcVol has two double parameters as a cone's radius and height. The method returns the cone's volume as a double, and
uses the calcBaseArea method to calculate the cone's base area. The volume is calculated by:
Volume base area height
Click here for example
Ex: If the input is then the output is:
Cone radius:
Cone height:
Base area:
Volume:
Note: Use Math.PI for public class ConeCalculations public static void mainString args double coneRadius; coneRadius scan.nextDouble; System.out.printlnCone radius: coneRadius; System.out.printfBase area: f
calcBaseAreaconeRadius; System.out.printff
calcVolconeRadius coneHeight; Failed to compile
ConeCalculations.java:: error: ; expected
return baseArea height ;
error
calcBaseArea has one double parameter as a cone's radius. The method returns the area of the cone's base as a double. The area of the base is calculated by:
calcVol has two double parameters as a cone's radius and height. The method returns the cone's volume as a double, and uses the calcBaseArea method to calculate the cone's base area. The volume is calculated by:
Click here for example
Ex: If the input is then the output is:
Cone radius:
Cone height:
Base area:
Volume:
Note: Use Math.PI for
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
