Advertisement
Guest User

Untitled

a guest
Sep 26th, 2017
66
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 0.57 KB | None | 0 0
  1. import java.util.*;
  2. public class PracticifValue
  3. {
  4.  
  5.     public static Scanner reader = new Scanner(System.in);
  6.     public static void main(String[] args)
  7.     {
  8.  
  9.         System.out.print("enter Length: ");
  10.         Double L = reader.nextDouble();
  11.         System.out.print("enter width: ");
  12.         Double W = reader.nextDouble();
  13.         if (L != W){System.out.println("it is not a squre its a rectangle");}
  14.        
  15.         if (L == W){
  16.             System.out.println("Length of the squre: ");
  17.             System.out.println(L*2+W*2);
  18.             System.out.println("width of the squre: ");
  19.             System.out.println(L*W);   
  20.         }
  21.        
  22.        
  23.        
  24.        
  25.     }
  26.  
  27. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement