ShippingContainer.java
1    package shapes;
2    
3    import java.util.Scanner;
4    
5    public class ShippingContainer {
6        public static void main(String[] args) {
7            double length = length();
8            double height = height() ;
9            double width = width();
10   
11           SRectangle face = new SRectangle(width, length); // get width and length
12           System.out.println("face = " + face);
13           SRectangle key = new SRectangle(face.diagonal(), height); // use first rectangle to get the diagonal then get the height
14           System.out.println("key = " + key);
15           double distance = key.diagonal(); // measures distance from the two far corners of the diagonal
16           System.out.println("diagonal = " + distance);
17       }
18   
19       private static double width() {
20           System.out.println("Please enter width of container: ");
21           Scanner scanner = new Scanner(System.in);
22           double width = scanner.nextDouble();
23           return width;
24       }
25   
26       private static double length() {
27           System.out.println("Please enter length of container: ");
28           Scanner scanner = new Scanner(System.in);
29           double length = scanner.nextDouble();
30           return length;
31       }
32   
33       private static double height() {
34           System.out.println("Please enter height of container: ");
35           Scanner scanner = new Scanner(System.in);
36           double height = scanner.nextDouble();
37           return height;
38       }
39   
40   }
41   
42   
43