Advertisement
cgorrillaha

Untitled

Nov 12th, 2020
179
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 0.52 KB | None | 0 0
  1. public class Basics {
  2.     public static void main(String[] args) {
  3.         //declarations
  4.         Scanner felix=new Scanner(System.in);
  5.        
  6.         int h, w;
  7.         int area;
  8.        
  9.         //inputs
  10.         //prompt for input
  11.         System.out.println("Give me height");
  12.         //read in input
  13.         h=felix.nextInt();
  14.  
  15.         System.out.println("Give me width");
  16.         w=felix.nextInt();
  17.        
  18.         //calculations
  19.         area=w*h;
  20.        
  21.         System.out.println("Area: "+area);
  22. }
  23. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement