package shapes; import shapes.SRectangle; import java.util.Scanner; import static java.lang.Math.*; import static java.lang.Math.sqrt; public class ShippingContainer { public static void main(String[] args) { Scanner prompt = new Scanner(System.in); System.out.println("Enter length: "); double length = prompt.nextDouble(); System.out.println("Enter height: "); double height = prompt.nextDouble(); System.out.println("Enter width: "); double width = prompt.nextDouble(); //1st way SRectangle face = new SRectangle(height, length); SRectangle key = new SRectangle(width, length); double diagonal = key.diagonal(); double distance = (sqrt(pow(face.height(), 2) + pow(diagonal, 2))); System.out.println("Distance from one conner to another (1st way answer): " + distance); //2nd way double diagonal2 = (sqrt(pow(length, 2) + pow(width, 2))); double distance2 = (sqrt(pow(height, 2) + pow(diagonal2, 2))); System.out.println("Distance from one conner to another (2nd way answer): " + distance2); //3rd way double distance3 = sqrt(pow(length, 2) + pow(height, 2) + pow(width, 2)); System.out.println("Distance from one conner to another (3rd way answer): " + distance3); } }