1 package shapes; 2 import java.util.Scanner; 3 import shapes.SRectangle; 4 5 /*This program computes the maximum length of an object that can placed in a shipping contiaing 6 *from a top corner to the opposite bottom corner. 7 */ 8 9 public class ShippingContainer { 10 public static void main(String args[]) { 11 Scanner drk = new Scanner(System.in); 12 13 System.out.println("Enter the width:"); 14 double width = drk.nextDouble(); 15 double w = width; 16 System.out.println("Enter the height:"); 17 double height = drk.nextDouble(); 18 double h = height; 19 System.out.println("Enter the length:"); 20 double length = drk.nextDouble(); 21 double l = length; 22 //double volume = ((width * height * length)); 23 //System.out.println("Volume Of Container is: " + volume); 24 SRectangle key = new SRectangle(w, l); 25 //System.out.println("Area of key: " + key.area()); 26 //System.out.println("Diagonal of key: " + key.diagonal()); 27 double faceL = key.diagonal(); 28 SRectangle face = new SRectangle(h, faceL); 29 //System.out.println("Area of face: " + face.area()); 30 System.out.println("Maximum Length of object from top corner to opposite lower corner: " + face.diagonal()); 31 32 33 } 34 35 } 36 37 38 39