@@ -0,0 +1,1986 @@
+/**%0A * Steven Ward%0A * VendingMachine.java %7C Drink Machine Project%0A *%0A * This file contains the definition of the VendingMachine abstract class, which is described below.%0A *%0A * Due Date: December 4, 2016%0A *%0A */%0A%0A/*%0A * TODO: Class-level documentation for VendingMachine class%0A */%0A%0Aimport java.util.Arrays;%0A%0Apublic abstract class VendingMachine %7B%0A  private double itemPrice;%0A  private Inventory inventory;%0A%0A  enum Money %7B%0A    PENNY(0.01), NICKEL(0.05), DIME(0.10), QUARTER(0.25), HALF_DOLLAR(0.50), DOLLAR(1.00);%0A    Money(double val) %7B this.value = val; %7D%0A    public double value( ) %7B return this.value; %7D%0A    private double value;%0A  %7D%0A%0A  protected abstract class Inventory %7B%0A    private final double price;%0A    private final Object%5B%5D products;%0A    private int%5B%5D stock;%0A%0A    protected Inventory(Object%5B%5D items, int initStock) %7B%0A      this.price = VendingMachine.this.itemPrice;%0A      this.products = items.clone();%0A      this.stock = new int%5Bitems.length%5D;%0A      Arrays.fill(this.stock, initStock);%0A    %7D%0A%0A    protected Inventory(Object%5B%5D items, int%5B%5D initStock) %7B%0A      if (items.length %3E initStock.length) %7B%0A        int ndiff = items.length - initStock.length;%0A        throw new IllegalArgumentException(%22Initial stock not provided for all available items - %22 + ndiff + %22 omitted.%22);%0A      %7D%0A      else if (initStock.length %3E items.length) %7B%0A        int ndiff = initStock.length - items.length;%0A        throw new IllegalArgumentException(%22Initial stock list provided contains trailing entries - %22 + ndiff + %22 additional.%22);%0A      %7D%0A      this.price = VendingMachine.this.itemPrice;%0A      this.products = items.clone();%0A      this.stock = initStock.clone();%0A    %7D%0A%0A    public abstract Object dispense(int item);%0A    public abstract int nRemaining(Object o);%0A    public abstract boolean soldOut(Object o);%0A    public boolean soldOut( ) %7B%0A      for (Object item : this.products) %7B%0A        if (!this.soldOut(item)) %7B%0A          return false;%0A        %7D%0A      %7D%0A      return true;%0A    %7D%0A  %7D%0A%7D%0A

Add VendingMachine abstract class - alternate solution attempt.