ShippingContainer.java
1    package shapes;
2    
3    import shapes.SRectangle;
4    import java.util.Scanner;
5    
6    public class ShippingContainer {
7        public static void main (String[] args) {
8            Scanner scanner = new Scanner(System.in);
9            System.out.println("input the width of the container:");
10           double width = scanner.nextDouble();
11           System.out.println("input the length of container:");
12           double length = scanner.nextDouble();
13           System.out.println("input the height of container:");
14           double height= scanner.nextDouble();
15   
16           System.out.println("dimensions of container are:");
17           System.out.println("the width---->"+ width);
18           System.out.println("the length---->"+ length);
19           System.out.println("the height ----->"+height);
20   
21           SRectangle face = new SRectangle(width,length);
22           System.out.println("face="+face.toString());
23           SRectangle key = new SRectangle(face.diagonal(),height);
24           System.out.println("key="+key.toString());
25           
26           double distance= key.diagonal();
27           System.out.println("the distance between two far corners of the containers="+ distance);
28           }
29   
30   
31       }
32   
33   
34