Created
February 13, 2014 04:13
-
-
Save JorgeOlvera/8969627 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Calculate and return the area of a circle, given the radius. | |
import java.util.Scanner; | |
public class circleArea { | |
public static void main (String[] args){ | |
Scanner input = new Scanner(System.in); | |
double radius = input.nextDouble(); | |
radius = calculateArea(radius); | |
System.out.println(radius + " square cm "); | |
} | |
public static double calculateArea(double radius){ | |
radius = (radius*radius)*3.141592; | |
return radius; | |
} | |
} | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment