Advertisement
M_Andreev

RectangleArea

Sep 7th, 2014
274
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 0.38 KB | None | 0 0
  1. import java.util.Scanner;
  2.  
  3. public class _01_RectangleArea {
  4.     public static void main(String[] args) {
  5.         Scanner sc = new Scanner(System.in);
  6.         System.out.print("Width: ");
  7.         double width = sc.nextDouble();
  8.         System.out.print("Height: ");
  9.         double height = sc.nextDouble();
  10.        
  11.         double area = width * height;
  12.         System.out.printf("The area of the rectangle is: %s", area);
  13.     }
  14. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement