1 /* 2 * Compute the distance of the longest item that can fit into a shipping container 3 * with the dimensions provided by the user. Fitting from bottom of one corner on bottom 4 * to top on opposite corner 5 */ 6 7 package shapes; 8 9 import java.util.Scanner; 10 11 public class ShippingContainer { 12 public static void main(String[] args){ 13 Scanner scanner = new Scanner(System.in); 14 System.out.print("Please enter the height of the container: "); 15 Double height = scanner.nextDouble(); 16 System.out.print("Please enter the length of the container: "); 17 Double length = scanner.nextDouble(); 18 System.out.print("Please enter the width of the container: "); 19 Double width = scanner.nextDouble(); 20 SRectangle face = new SRectangle(height, length); 21 SRectangle key = new SRectangle(face.diagonal(), width); 22 Double distance = key.diagonal(); 23 System.out.println("The distance of the object that will fit diagonally in the shipping container is: " + 24 distance); 25 } 26 27 } 28