ShippingContainer.java
1    package shapes;
2    import java.util.Scanner;
3    import shapes.SRectangle;
4    public class ShippingContainer {
5        public static void main(String[] args) {
6    
7            //Introduced a Scanner
8            Scanner scanner = new Scanner(System.in);
9    
10           //This part asks the user for the three integer dimensions
11           System.out.print( "Enter container width:");
12           int ContainerWidth =scanner.nextInt();
13   
14           System.out.print ("Enter container length:");
15           int ContainerLength =scanner.nextInt();
16   
17           System.out.print ("Enter container height:");
18           int ContainerHeight =scanner.nextInt();
19   
20           // Now I'm binding the variable face to a rectangle. You used the variables
21           //ContainerWidth and height, but you are still confused with this part.
22           // Ask TA questions
23           SRectangle face = new SRectangle(ContainerLength,ContainerWidth );
24           double curtainlength = face.diagonal();
25   
26   
27   
28   
29           //This part is from the envelope code. Only difference is that
30           // you're not dividing the height by 2.
31           // This is the key
32          SRectangle key = new SRectangle(curtainlength,ContainerHeight);
33          double distance = key.diagonal();
34   
35          //Creating a new rectangle for the key
36   
37   
38           System.out.println("distance="+distance);
39   
40   
41   
42   
43   
44       }
45   }