您的位置:首页 > 其它

第四周作业-周末提高班

2014-03-29 19:40 190 查看
import java.util.Scanner;

public class CylinderVolume
{
public static void main(String args[])
{
final double PI=3.14159;
Scanner input=new Scanner(System.in);

System.out.print("Enter the radius and length of a cylinder:");
double radius=input.nextDouble();
double length=input.nextDouble();
//conver Cylinder Volume
double area;
double volume;
area=radius*radius*PI;
volume=area*length;
System.out.println("The area of the circle is"+area);
System.out.println("The volume of the cylinder is"+volume);
}
}


内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: