ShippingContainer.java
1    package shapes;
2    
3    import java.util.Scanner;
4    
5    public class ShippingContainer {
6    
7        public static void main(String[] args) {
8            double containerHeight = containerHeight();
9            double containerWidth = containerWidth();
10           double containerLength = containerLength();
11           SRectangle face = new SRectangle(containerWidth, containerLength);
12           SRectangle key = new SRectangle(containerHeight, face.diagonal());
13           double distance = key.diagonal();
14           System.out.println("The distance from one corner of rectangular Shipping Container to the far corner is " + distance + "ft");
15       }
16   
17       private static double containerLength() {
18           System.out.println("Please enter the Length of the Container: ");
19           Scanner scanner = new Scanner(System.in);
20           double containerLength = scanner.nextDouble();
21           return containerLength;
22       }
23   
24       private static double containerHeight() {
25           System.out.println("Please enter the Height of the Container: ");
26           Scanner scanner = new Scanner(System.in);
27           double containerHeight = scanner.nextDouble();
28           return containerHeight;
29       }
30   
31       private static double containerWidth() {
32           System.out.println("Please enter the Width of the Container: ");
33           Scanner scanner = new Scanner(System.in);
34           double containerWidth = scanner.nextDouble();
35           return containerWidth;
36       }
37   
38   
39   }
40