首页 > 其他 > 详细

作业: 1.8(圆的面积和周长)编写程序,使用以下的公式计算并显示半径为5.5的圆的面积和周长。

时间:2017-09-25 09:24:28      阅读:559      评论:0      收藏:0      [点我收藏+]

public class Demo_1

{
         public static void main(String[] args)

         {

           double radius,C;
           double area;
           radius=5.5;
           area=radius*radius*Math.PI;
           C=radius*2*3.14150;
           System.out.println("the area for the circle of radius " + radius + " is " + area);
           System.out.println("the circumference for the circle of radius " + radius + " is "+ area);
           }
}

 

 

技术分享

作业: 1.8(圆的面积和周长)编写程序,使用以下的公式计算并显示半径为5.5的圆的面积和周长。

原文:http://www.cnblogs.com/jingjing1314/p/7590269.html

(0)
(0)
   
举报
评论 一句话评论(0
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!