. Develop the program calculateCylinderVolume., which accepts radius of a cylinder's base disk and its height and computes the volume of the cylinder.
Hi Friend,
Try the following code:
import java.util.*;
class CalculateCyliderVolume
{
public static void main(String[] args)
{
double PI=3.14;
Scanner input=new Scanner(System.in);
System.out.print("Enter Radius: ");
double r=input.nextDouble();
System.out.print("Enter Height: ");
double h=input.nextDouble();
double volume=PI*r*r*h;
System.out.println("Volume of Cylinder: "+volume);
}
}
Thanks