/* * This program is to find th longest diagonal in a rectangular prism. */ package shapes; import shapes.SRectangle; import shapes.SSquare; import java.util.Scanner; public class ShippingContainer { public static void main(String[] args) { double Length = Length(); double Width = Width(); double Height = Height(); double distance = key(Length,Width,Height); System.out.println(distance); } private static double key(double l, double w, double h) { SRectangle face = new SRectangle(l,w); SRectangle key = new SRectangle(face.diagonal(),h); return key.diagonal(); } private static double Length() { System.out.print("Please enter the length of the container: "); Scanner scanner = new Scanner(System.in); double Length = scanner.nextDouble(); return Length; } private static double Width() { System.out.print("Please enter the width of the container: "); Scanner scanner = new Scanner(System.in); double Width = scanner.nextDouble(); return Width; } private static double Height() { System.out.print("Please enter the width of the container: "); Scanner scanner = new Scanner(System.in); double Height = scanner.nextDouble(); return Height; } private static double surfaceArea(double edgeLength) { SSquare face = new SSquare(edgeLength); int nrOfFaces = 6; double surfaceArea = face.area() * nrOfFaces; return surfaceArea; } }