ShippingContainer.java

/* 
 *ASSIGNMENT 3 PROBLEM 4 
 * THE SHIPPING CONTAINER 
 */
package Shapes;

import shapes.SRectangle;
import java.util.Scanner;

public class ShippingContainer {
    public static void main(String[] args) {
        // INTRODUCED SCANNER TO ASK FOR THE VALUE OF THE LENGTH WIDTH AND HEIGHT
        Scanner scanner = new Scanner(System.in);
        System.out.println("input the length of container ");
        double length = scanner.nextDouble();
        System.out.println("input the width of container ");
        double width = scanner.nextDouble();
        System.out.println("input the height of container ");
        double height = scanner.nextDouble();

        // PRINT OUT THE VALUES FOR THE CALCULATION
        System.out.println("demensions of container are");
        System.out.println("the length =" + length);
        System.out.println("the width = " + width);
        System.out.println("the height = " + height);

        // CALCULATING THE DISTACE BETWEEN TWO FAR CONCER OF THE CONTAINER
        SRectangle face = new SRectangle(width, length);
        SRectangle key = new SRectangle(face.diagonal(), height);

        double distance = key.diagonal();
        System.out.println("the distance between two far concer of the container =" + distance);

    }
}