0

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

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));
}
}

While pursuing a Computer Science degree, I founded DaniWeb.com, an online community for developers and IT professionals. I coded the backend platform from the ground up and I also do all of the advertising sales and SEO. I'm a super-geeky programmer with a passion for Internet marketing.

1
Contributor
0
Replies
2
Views
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.