1 package shapes; 2 3 import java.util.Scanner; 4 5 public class ShippingContainer { 6 public static void main(String[] args) { 7 double h = height(); 8 double w = width(); 9 double l = length(); 10 SRectangle rec = new SRectangle (h, w); 11 double c = rec.diagonal(); 12 SRectangle rec2 = new SRectangle (l, c); 13 double distance = rec2.diagonal(); 14 15 System.out.println("distance = " + distance); 16 17 } 18 19 private static double height() { 20 System.out.print("Please enter the height of the shipping containter: "); 21 Scanner scanner = new Scanner(System.in); 22 double height = scanner.nextDouble(); 23 return height; 24 } 25 26 private static double width() { 27 System.out.print("Please enter the width of the shipping containter: "); 28 Scanner scanner = new Scanner(System.in); 29 double width = scanner.nextDouble(); 30 return width; 31 } 32 33 private static double length() { 34 System.out.print("Please enter the length of the shipping containter: "); 35 Scanner scanner = new Scanner(System.in); 36 double length = scanner.nextDouble(); 37 return length; 38 } 39 40 } 41