ShippingContainer.java
1    package shapes;
2    
3    import shapes.SCircle;
4    import shapes.SRectangle;
5    import shapes.SSquare;
6    import java.util.Scanner;
7    import javax.swing.*;
8    import java.awt.Color;
9    
10   public class ShippingContainer {
11       public static void main(String[] args){
12           Scanner scanner = new Scanner(System.in);
13           System.out.print("Width?");
14           int width = scanner.nextInt();
15           System.out.print("Height?");
16           int height = scanner.nextInt();
17           System.out.print("Length?");
18           int length = scanner.nextInt();
19           System.out.println(width);
20           System.out.println(height);
21           System.out.println(length);
22           SRectangle face = new SRectangle(length, width);
23           double bottomside = face.diagonal();
24           SRectangle key = new SRectangle(height, bottomside);
25           double distance = key.diagonal();
26           System.out.println(" length of key = " + distance);
27   
28       }
29   }
30