ofekkfir

exercise 5

Oct 22nd, 2017
106
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 0.66 KB | None | 0 0
  1. import java.util.Scanner;
  2.  
  3.  
  4. public class targil5
  5. {
  6.     static Scanner reader = new Scanner(System.in);
  7.  
  8.     /**
  9.      * @param args
  10.      */
  11.     public static void main(String[] args)
  12.     {
  13.         int length;
  14.         int weidth;
  15.         System.out.println("enter length");
  16.         length = reader.nextInt();
  17.         System.out.println("enter weidth");
  18.         weidth = reader.nextInt();
  19.         System.out.println(length);
  20.         System.out.println(weidth);
  21.         System.out.println("hikef - " +(length+weidth)*2);
  22.         System.out.print("setah - " + length*weidth );
  23.        
  24.         if (length == weidth)
  25.         {
  26.             System.out.println(" square");
  27.            
  28.         }
  29.         else
  30.         {
  31.             System.out.println(" Not square");
  32.         }
  33.        
  34.        
  35.        
  36.  
  37.     }
  38.  
  39. }
Advertisement
Add Comment
Please, Sign In to add comment