ShippingContainer.java
1    /* 
2    Program to calculate the largest object that can fit in inputted container 
3     */
4    
5    package shapes;
6    
7    import java.util.Scanner;
8    
9    public class ShippingContainer {
10   
11       public static void main(String[] args){
12   
13           //The IO stream for prompting and entering values for h, l, and w
14           Scanner ScanGuy = new Scanner(System.in);
15           System.out.println("Enter The Length: ");
16           double Length = ScanGuy.nextDouble();
17           System.out.println("Enter The Width: ");
18           double Width = ScanGuy.nextDouble();
19           System.out.println("Enter The Height: ");
20           double Height = ScanGuy.nextDouble();
21   
22           //Objects
23           SRectangle Opening = new SRectangle(Height, Width);
24           SRectangle Key = new SRectangle(Opening.diagonal(), Length);
25   
26           //The answer and its output
27           double Distance = Key.diagonal();
28           System.out.println("The Diagonal Distance is: " + Distance);
29       }
30   }
31