/**
 *
 * @author Stephen Hole
 * 
 */

public class Box {
    //class Box instance variables
    private double width;
    private double height;
    private double depth;
    
    Box(double width, double height, double depth) {
        System.out.println("Constructing your new Box");
        setWidth(width);
        setHeight(height);
        setDepth(depth);
    }
    //method to calculate and return the volume of a box
    double volume() {
        double vol;
        vol = width * height * depth;
        
        return vol;
    }  
    
    //method to set width
    public void setWidth(double width) {
        //set maximum width to 100
        if (width > 100) {
            System.out.println("The maximum width of 100 has been exceeded, therefore width set to 0.");
        } else {
            this.width = width;
            System.out.println("Width ok.");
        } 
    }
    
    //method to set width
    public void setHeight(double height) {
        //set maximum height to 100
        if (height > 100) {
            System.out.println("The maximum height of 100 has been exceeded, therefore width set to 0.");
        } else {
            this.height = height;
            System.out.println("Height ok."); 
        } 
    }
    
    //method to set width
    public void setDepth(double depth) {
        //set maximum depth to 100
        if (depth > 100) {
            System.out.println("The maximum depth of 100 has been exceeded, therefore width set to 0.");
        } else {
            this.depth = depth;
            System.out.println("Depth ok."); 
        } 
    }
    
    //method to get width
    public double getWidth() {
        return width;
    }
    
    //method to get height
    public double getHeight() {
        return height;
    }
    
    //method to get depth
    public double getDepth() {
        return depth;
    }
}