ShippingContainer.java
1    /* 
2    *compute the distance from one corner of a rectangular shipping container on the floor (bottom) to its far corner on the ceiling (top). 
3    * 
4     */
5    
6    package shapes;
7    
8    import java.util.Scanner;
9    import shapes.SRectangle;
10   
11   public class ShippingContainer {
12   
13       public static void main(String[] args) {
14           //VARIABLES FOR DIMENSIONS
15           double height = height();
16           double width = width();
17           double length = length();
18   
19           //CREATING THE SHIPPING CONTAINER
20           SRectangle face = new SRectangle(length,width);
21           SRectangle key = new SRectangle(face.diagonal(),height);
22           double distance = key.diagonal();
23           System.out.println("distance = " + distance);
24       }
25   
26       private static double length() {
27           System.out.print("Please enter the length of the Shipping Container: ");
28           Scanner scanner = new Scanner(System.in);
29           double length = scanner.nextDouble();
30           return length;
31       }
32   
33       private static double width() {
34           System.out.print("Please enter the width of the Shipping Container: ");
35           Scanner scanner = new Scanner(System.in);
36           double width = scanner.nextDouble();
37           return width;
38       }
39   
40       private static double height() {
41           System.out.print("Please enter the height of the Shipping Container: ");
42           Scanner scanner = new Scanner(System.in);
43           double height = scanner.nextDouble();
44           return height;
45       }
46   
47   
48   
49   
50       }
51