具有数学功能的圆形面积计算器
import java.util.Scanner; public class CircleAreaApp /**来自 n o w j a v a . c o m - 时 代 Java**/ { static Scanner sc = new Scanner(System.in); public static void main(String[] args) { System.out.println("Welcome to the circle area calculator."); System.out.print("Enter the radius of your circle: "); double r = sc.nextDouble();//时代Java公众号 - nowjava.com 提 供 double area = Math.PI * (r * r); System.out.println("The area is " + area); } }