/** * 需求:計算出圓的面積,周長 * 思路:利用公式,調用Math.PI * * 步驟:略 */ 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); } }