1 package shapes; 2 3 import java.util.Scanner; 4 5 public class ShippingContainer { 6 7 static double width; 8 static double length; 9 static double height; 10 11 static SRectangle Face; 12 static double distance; 13 14 public static void setDimensions(Scanner scan){ 15 System.out.println("Width"); 16 width = scan.nextDouble(); 17 18 System.out.println("Length"); 19 length = scan.nextDouble(); 20 21 height = scan.nextDouble(); 22 Face = new SRectangle(length, width); 23 24 System.out.println("Dimensions"); 25 System.out.println("Width : " + width + " | Length : " + length + " | Height : " + height); 26 } 27 28 public static void getCalculations() { 29 SRectangle key = new SRectangle(height, Face.diagonal()); 30 double keyWidth = Face.diagonal(); 31 double keyHeight = height; 32 double keyArea = key.area(); 33 distance = key.diagonal(); 34 double longestObject = distance; 35 36 37 System.out.println("Key Width: " + keyWidth); 38 System.out.println("Key Height: " + keyHeight); 39 System.out.println("Key Area: " + keyArea); 40 System.out.println("Diagonal Rect. Prism Distance : " + longestObject); 41 } 42 43 public static void main(String[] args) { 44 Scanner scanner = new Scanner(System.in); 45 setDimensions(scanner); 46 getCalculations(); 47 } 48 } 49