ShippingContainer.java
1    package shapes;
2    
3    import shapes.SRectangle;
4    import java.util.Scanner;
5    
6    public class ShippingContainer {
7    
8        public static void main(String[] args) {
9            Scanner scanner = new Scanner(System.in);
10   
11           System.out.println("Enter width of container = ");
12           int width = scanner.nextInt();
13           System.out.println("Enter length of container = ");
14           int length = scanner.nextInt();
15           System.out.println("Enter height of container = ");
16           int height = scanner.nextInt();
17   
18           SRectangle floor = new SRectangle(width, length);
19   
20           double keyLength = floor.diagonal();
21           double keyWidth = (height);
22   
23           SRectangle key = new SRectangle(keyLength, keyWidth);
24           double keyDiagonal = key.diagonal();
25           System.out.println("Object in a shipping container diagonally = " + keyDiagonal);
26       }
27   }
28