2.34 Clone of LAB: Volume and area of cylinder
The volume and area of a cylinder are calculated as:
\( Volume = \pi r^2 h \)
\( Area = 2\pi rh + 2\pi r^2 \)
Given the radius and height of a cylinder as floating-point (double) numbers, output the volume and area of the cylinder.
Hint: Use Math.pow() and Math.PI in your calculations.
Output each floating-point value with two digits after the decimal point using the following statement:
System.out.printf("Volume (cubic inches): %.2f\n", yourValue);
Ex: If the input is:
5.2 8.1
where 5.2 is the radius of the cylinder and 8.1 is the height of the cylinder, then the output is:
Volume (cubic inches): 688.08
Surface area (square inches): 434.55
480692.3626996.qx3zqy7
LAB
ACTIVITY
2.34.1: LAB: Volume and area of cylinder
0/10
LabProgram.java
Load default template...