public class Inventory
{
    public final int CRITICAL = 10;
    public final int MIN = 0;
    public final int MAX = 100;
    private int stockLevel = 0;

    // Method definitions
    public boolean inventoryTooLow()
    {
	if (stockLevel < CRITICAL)
	    return true;
	else
	    return false;
    }

    public void add(int amount)
    {
        int temp;
        temp = stockLevel + amount;
        if (temp > MAX)
	{
	    System.out.println();
	    System.out.print("Adding " + amount + " item will cause stock ");
	    System.out.println("to become greater than " + MAX + " units (overstock)");
	}
        else
	{
	    stockLevel = temp;
	}
    } // End of method add

    public void remove (int amount)
    {
        int temp;
	   temp = stockLevel - amount;
        if (temp < MIN)
	{
	    System.out.print("Removing " + amount + " item will cause stock ");
	    System.out.println("to become less than " + MIN + " units (understock)");
	}
	else
	{
	    stockLevel = temp;
	}
    }

    public String showStockLevel() 
    { 
	   return("Inventory: " + stockLevel); 
    }  
}
