ShippingContainer.java
1    package shapes;
2    
3    import java.util.Scanner;
4    
5    public class ShippingContainer {
6        public static void main(String[] args) {
7            Scanner scanner = new Scanner(System.in);
8            System.out.println("Write three dimensions ( Width, Length, and Height) in that order: ");
9    
10           int counter = 0;
11   
12           double width = 0;
13           double length = 0;
14           double height = 0;
15   
16           while (counter < 1) {
17               int widthInt = scanner.nextInt();
18               int lengthInt = scanner.nextInt();
19               int heightInt = scanner.nextInt();
20               width = width + widthInt;
21               length = length + lengthInt;
22               height = height + heightInt;
23   
24               counter = counter + 1;
25   
26           }
27           System.out.println(width);
28           System.out.println(length);
29           System.out.println(height);
30   
31           SRectangle face = new SRectangle(width, length);
32           SRectangle newRec = new SRectangle(face.diagonal(), height);
33           double key = newRec.diagonal();
34           System.out.println("The longest object that can fit into this container is " + key + " long");
35       }
36   }