A simplistic program to compute the volume of a cylinder when its radius and length are input via MyInput.class

75 Views
package cylindervolume;
public class CylinderVolume
{
public static void main(String args[])
{
double pi = 3.14;
double radius, length;
System.out.print("Please enter radius of cylinder: ");
radius = MyInput.readDouble();
System.out.print("Please enter length of cylinder: ");
length = MyInput.readDouble();
System.out.print("Volume = " + (radius*radius*pi*length));
}
}
About the Author

I'm a super-geeky programmer with a passion for Internet marketing. :)