Advertisement
mmayoub

Ex03, 17.04.2021

Apr 20th, 2021
988
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 0.45 KB | None | 0 0
  1. //17.04.2021
  2. import java.util.Scanner;
  3.  
  4. public class Ex03 {
  5.  
  6.     public static void main(String[] args) {
  7.         // TODO Auto-generated method stub
  8.         Scanner in = new Scanner(System.in);
  9.         double a;
  10.         double msaha;
  11.         double moheet;
  12.  
  13.         System.out.print("Enter the length: ");
  14.         a = in.nextDouble();
  15.  
  16.         msaha = a * a;
  17.         moheet = 4 * a;
  18.  
  19.         System.out.println("area = " + msaha);
  20.         System.out.println("perimeter = " + moheet);
  21.  
  22.         in.close();
  23.     }
  24.  
  25. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement