Advertisement
Guest User

The Rectangle Facts

a guest
Nov 28th, 2015
67
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 0.61 KB | None | 0 0
  1. //kelly tan
  2. //The rectangle facts
  3. import java.util.*;
  4.  
  5. public class RectangleFacts
  6. {
  7.   public static void main (String [] args)
  8.   {
  9.     Scanner input = new Scanner(System.in);
  10.     System.out.print("Enter the length");
  11.     double length = input.nextDouble();
  12.     System.out.print("Enter the width");
  13.     double width = input.nextDouble();
  14.     System.out.print(length + width );
  15.     double perimeter = length + width;
  16.     System.out.println("The perimeter is " + perimeter );
  17.     System.out.print( 2*(length) + 2*(width) );
  18.     double area = 2*(length) + 2*(width);
  19.     System.out.println("The area is " + area);
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement