1 package shapes; 2 import java.util.Scanner; 3 import shapes.SRectangle; 4 public class ShippingContainer { 5 6 7 8 9 10 public static void main(String[] args) { 11 12 double key = key(); 13 System.out.println("Max length = " + key); 14 15 16 } 17 private static double edgeLength() { 18 System.out.println("Please enter the edge length of the cube: "); 19 Scanner scanner = new Scanner(System.in); 20 double edgeLength = scanner.nextDouble(); 21 22 return edgeLength; 23 24 } 25 26 27 private static double height() { 28 System.out.println("Please enter the height of the cube: "); 29 Scanner scanner = new Scanner(System.in); 30 double height = scanner.nextDouble(); 31 return height; 32 33 } 34 private static double width() { 35 System.out.println("Please enter the width length of the cube: "); 36 Scanner scanner = new Scanner(System.in); 37 double width = scanner.nextDouble(); 38 return width; 39 40 } 41 42 43 44 private static double wall() { 45 46 SRectangle wall = new SRectangle(edgeLength(),height()); 47 48 49 double face = wall.diagonal(); 50 51 return face; 52 } 53 54 private static double key() { 55 56 SRectangle floor = new SRectangle(wall(),width()); 57 58 double key = floor.diagonal(); 59 60 return key; 61 } 62 63 64 65 66 } 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84