ShippingContainer.java
1    /* 
2     * Program to find diagonal of rectangular prism. 
3     */
4    
5    package shapes;
6    
7    import java.util.Scanner;
8    import shapes.SRectangle;
9    
10   public class ShippingContainer {
11   
12       public static void main(String[] args) {
13           double length = length();
14           double width = width();
15           double height = height();
16           SRectangle bottomrectangle = new SRectangle(width, length);
17           double bottomrectanglediagonal = bottomrectangle.diagonal();
18           SRectangle curtain = new SRectangle(height, bottomrectanglediagonal);
19           double answer = curtain.diagonal();
20           System.out.println("The Diagonal Of The Container = " + answer);
21       }
22   
23       private static double length() {
24           System.out.print("Please enter the length of the container: ");
25           Scanner scanner = new Scanner(System.in);
26           double length = scanner.nextDouble();
27           return length;
28       }
29   
30       private static double width() {
31           System.out.print("Please enter the width of the container: ");
32           Scanner scanner = new Scanner(System.in);
33           double width = scanner.nextDouble();
34           return width;
35       }
36   
37       private static double height() {
38           System.out.print("Please enter the height of the container: ");
39           Scanner scanner = new Scanner(System.in);
40           double height = scanner.nextDouble();
41           return height;
42       }
43   
44   }
45