Advertisement
hamaXD

LAB1 Main

Jan 31st, 2018
122
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 0.39 KB | None | 0 0
  1. import java.util.Scanner;
  2.  
  3. public class Main{
  4.     public static void main(String[] args){
  5.         int field_width,field_area;
  6.  
  7.         Scanner in = new Scanner(System.in);
  8.         Square one = new Square();
  9.  
  10.         System.out.print("Enter_width: ");
  11.         field_width =in.nextInt();
  12.        
  13.         one.setWidth(field_width);
  14.         one.calcArea();
  15.         field_area= one.showArea();
  16.         System.out.print("Area : "+field_area);
  17.    
  18.  
  19.     }
  20. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement