Click Here to go back to the homepage.

Estimating the Area of a Circle Solution:


import java.util.Scanner;

public class Kattis {
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        double foo = sc.nextDouble();
        double foo2 = sc.nextInt();
        double foo3 = sc.nextInt();
        while(foo != 0){
            System.out.println(Math.PI * foo * foo + " " + (2 * foo * (2 * foo) * (foo3 / foo2)));
            foo = sc.nextDouble();
            foo2 = sc.nextInt();
            foo3 = sc.nextInt();
        }
    }
}