Advertisement
Guest User

Untitled

a guest
Apr 20th, 2019
111
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.47 KB | None | 0 0
  1. import java.util.Scanner;
  2.  
  3. public class CircleAreaAndPerimeter {
  4. public static void main(String[] args) {
  5. Scanner console = new Scanner(System.in);
  6. double redius = Double.parseDouble(console.nextLine());
  7.  
  8.  
  9. double area = Math.PI * radius * radius;
  10. double perimeter = Math.PI * radius * 2;
  11.  
  12.  
  13. System.out.printlntf("%.2f", area);
  14. System.out.println();
  15. System.out.printf("%.2f", perimeter);
  16.  
  17. }
  18.  
  19.  
  20. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement