Advertisement
damoncard

Circle

Aug 29th, 2014
227
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 0.47 KB | None | 0 0
  1. import java.util.Scanner; // import Scan method
  2. public class Circle // Class or file name
  3. {
  4.  public static void main(String [] args)
  5.  {
  6.    System.out.print("Please, insert your radius");
  7.    Scanner rad = new Scanner (System.in);
  8.    double r = rad.nextDouble(); // create a Double (Integer with floating values) to scan your value
  9.    System.out.println("Area of this circle is "+Math.PI*r*r);
  10.    System.out.println("Circumference of this circle is "+2*Math.PI*r);
  11.  }
  12. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement