Advertisement
deyanivanov966

08. Circle Area and Perimeter

Apr 10th, 2021
149
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 0.46 KB | None | 0 0
  1. import java.util.Scanner;
  2.  
  3. public class T17 {
  4.     public static void main(String[] args) {
  5.         Scanner scanner = new Scanner(System.in);
  6.  
  7.         double RadiusR = Double.parseDouble(scanner.nextLine());
  8.  
  9.         double CalcArea = (RadiusR * RadiusR) * Math.PI;
  10.         double CalcParameter = 2 * Math.PI * RadiusR;
  11.  
  12.         System.out.printf("%.2f", CalcArea);
  13.         System.out.println();
  14.         System.out.printf("%.2f", CalcParameter);
  15.  
  16.     }
  17. }
  18.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement