1 package shapes; 2 3 import java.util.Scanner; 4 5 public class ShippingContainer { 6 7 public static void main(String[] args) { 8 9 double width = width(); 10 double length = length(); 11 double height = height(); 12 System.out.println("Width of the shipping container = " + width); 13 System.out.println("Length of the shipping container = " + length); 14 System.out.println("Height of the shipping container = " + height); 15 16 SRectangle face = new SRectangle(width, length); 17 SRectangle key = new SRectangle(height, face.diagonal()); 18 double distance = key.diagonal(); 19 System.out.println("Distance between corners = " + distance); 20 21 22 23 24 } 25 26 27 private static double width() { 28 System.out.print("Enter the width of the shipping container: "); 29 Scanner scanner = new Scanner(System.in); 30 double width = scanner.nextDouble(); 31 return width; 32 } 33 34 private static double length() { 35 System.out.print("Enter the length of the shipping container: "); 36 Scanner scanner = new Scanner(System.in); 37 double length = scanner.nextDouble(); 38 return length; 39 40 } 41 42 private static double height() { 43 System.out.print("Enter the height of the shipping container: "); 44 Scanner scanner = new Scanner(System.in); 45 double height = scanner.nextDouble(); 46 return height; 47 } 48 49 50 } 51