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 *1.03.0
Click here for example
Ex: If the input is 2.03.0, then the output is:
Cone radius: 2.0
Cone height: 3.0
Base area: 12.6
Volume: 12.6
Note: Use Math.PI for . public class ConeCalculations {public static void main(String[] args){ double coneRadius; coneRadius = scan.nextDouble(); System.out.println("Cone radius: "+ coneRadius); System.out.printf("Base area: %.1f
", calcBaseArea(coneRadius)); System.out.printf("%.1f
", calcVol(coneRadius, coneHeight)); Failed to compile
ConeCalculations.java:15: error: ';' expected
return baseArea height (1.0/3.0);
1 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 2.03.0, then the output is:
Cone radius: 2.0
Cone height: 3.0
Base area: 12.6
Volume: 12.6
Note: Use Math.PI for
.
Define the following methods: calcVol ( ) has two

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 Programming Questions!