Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- public class Basics {
- public static void main(String[] args) {
- //declarations
- Scanner felix=new Scanner(System.in);
- int h, w;
- int area;
- //inputs
- //prompt for input
- System.out.println("Give me height");
- //read in input
- h=felix.nextInt();
- System.out.println("Give me width");
- w=felix.nextInt();
- //calculations
- area=w*h;
- System.out.println("Area: "+area);
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement