1 package shapes; 2 import shapes.SRectangle; 3 import shapes.SSquare; 4 import java.util.Scanner; 5 6 public class ShippingContainer { 7 //SOLUTION TO THE SHIPPING CONTAINER PROBLEM 8 9 public static void main(String[] args) { 10 11 Scanner scanner = new Scanner (System.in); 12 13 double heightofcontainer = scanner.nextDouble(); 14 15 double widthofcontainer = scanner.nextDouble(); 16 17 double lengthofcontainer = scanner.nextDouble(); 18 19 SRectangle containerface = new SRectangle(heightofcontainer, lengthofcontainer); 20 21 double curtainlength = containerface.diagonal(); 22 23 SRectangle AreaOfCurtain = new SRectangle( curtainlength, widthofcontainer); 24 25 double key = AreaOfCurtain.diagonal(); 26 27 System.out.println("distance between diagonal corners" + key); 28 29 } 30 } 31