ShippingContainer.java
1    /* 
2    * A program to compute the distance from one corner of a rectangular shipping container on the floor to its far corner on the ceiling 
3     */
4    
5    package shapes;
6    import java.util.Scanner;
7    
8    public class ShippingContainer {
9        public static void main(String[] args){
10           Scanner sc = new Scanner(System.in);
11   
12           System.out.println("Enter height:");
13           double height = sc.nextDouble();
14   
15           System.out.println("Enter width:");
16           double width = sc.nextDouble();
17   
18           System.out.println("Enter length:");
19           double length = sc.nextDouble();
20   
21           SRectangle face = new SRectangle (length,width);
22           double distance = face.diagonal();
23           SRectangle key = new SRectangle (distance, height);
24   
25           System.out.println("Distance from bottom left corner to the top right corner: " + key.diagonal());
26       }
27   }
28