ShippingContainer.java
1    /* 
2    This program will solve the Shipping Container problem from Assignment 3. 
3     */
4    
5    package shapes;
6    
7    import java.util.Scanner;
8    
9    public class ShippingContainer {
10       public static void main(String[] args) {
11   
12           Scanner width = new Scanner(System.in);
13           Scanner length = new Scanner(System.in);
14           Scanner height = new Scanner(System.in);
15   
16           System.out.print("Enter a width: ");
17           double widthNumber = width.nextInt();
18   
19           System.out.print("Enter a length: ");
20           double lengthNumber = length.nextInt();
21   
22           System.out.print("Enter a height: ");
23           double heightNumber = height.nextInt();
24   
25           SRectangle face = new SRectangle(lengthNumber, widthNumber);
26   
27           double diagonal = face.diagonal();
28   
29           SRectangle key = new SRectangle(diagonal, heightNumber);
30   
31           double distance = key.diagonal();
32   
33           System.out.println("Distance from one corner of a rectangular shipping container on the floor to its far corner on the ceiling = " + distance);
34   
35   
36       }
37   }