Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- //kelly tan
- //The rectangle facts
- import java.util.*;
- public class RectangleFacts
- {
- public static void main (String [] args)
- {
- Scanner input = new Scanner(System.in);
- System.out.print("Enter the length");
- double length = input.nextDouble();
- System.out.print("Enter the width");
- double width = input.nextDouble();
- System.out.print(length + width );
- double perimeter = length + width;
- System.out.println("The perimeter is " + perimeter );
- System.out.print( 2*(length) + 2*(width) );
- double area = 2*(length) + 2*(width);
- System.out.println("The area is " + area);
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement