ShippingContainer.java
1    /* 
2     * this program will calculate the distance from one corner of shipping container to 
3     */
4    
5    package shapes;
6    
7    import java.util.Scanner;
8    
9    public class ShippingContainer {
10       public static void main(String[]args){
11           Scanner scanner= new Scanner(System.in);
12   
13           System.out.println("Enter an integer:");
14           int length= scanner.nextInt();
15           System.out.println("Length="+ length);
16           int width= scanner.nextInt();
17           System.out.println("Width="+width);
18   
19           int height= scanner.nextInt();
20           System.out.println("Height="+height);
21   
22           //introduce the face,key and rectangle.
23   
24           SRectangle face= new SRectangle(length, height );
25           System.out.println("areaOfFace="+face.area());
26   
27           SRectangle key= new SRectangle(face.diagonal(), width);
28           System.out.println("areaOfKey="+key.area());
29           double diagonal= key.diagonal();
30           System.out.println("Distance between diagonal corner="+diagonal);
31   
32       }
33   }