/**
 * Steven Ward
 * MachineController.java | Drink Machine Project
 *
 * This file contains the definition of the MachineController class, which is described below.
 *
 * Due Date: December 4, 2016
 *
 */

import java.text.NumberFormat;
import java.util.ArrayList;
import java.util.List;
import java.util.Locale;

public class MachineController {
  public static final double DRINK_PRICE = 0.75;
  public static final NumberFormat currency_format = NumberFormat.getCurrencyInstance(Locale.US);

  private int[] inventory = { 10, 10, 10 };
  private List<Coin> paid = new ArrayList<>();
  private boolean canPurchase = false;

  enum Coin {
    PENNY(0.01), NICKEL(0.05), DIME(0.10), QUARTER(0.25), HALF_DOLLAR(0.50), DOLLAR(1.00);
    Coin(double val) { this.value = val; }
    public double value( ) { return this.value; }
    private final double value;
  }

  enum Drinks {
    COLA(0), LEMON_LIME(1), WATER(2);
    Drinks(int i) { this.i = i; }
    public int toInt( ) { return this.i; }
    private final int i;
  }

  public boolean canPurchase( ) { return this.canPurchase; }

  public double getAmountPaid( ) {
    double amountPaid = 0.0;
    for (Coin coin : this.paid) {
      amountPaid += coin.value();
    }
    return amountPaid;
  }

  public boolean insertCoin(final Coin coin) {
    if (this.canPurchase) {
      return false;
    }
    else {
      this.paid.add(coin);
      this.canPurchase = this.getAmountPaid() >= DRINK_PRICE ? true : canPurchase;
      return true;
    }
  }

}

@@ -872,23 +872,15 @@
 rink
-s
  %7B
-%0A   
  COLA
-(0)
 , LE
@@ -891,128 +891,18 @@
 LIME
-(1)
 , WATER
-(2);%0A    Drinks(int i) %7B this.i = i; %7D%0A    public int toInt( ) %7B return this.i; %7D%0A    private final int i;%0A 
  %7D
+;
 %0A%0A  
@@ -1379,10 +1379,241 @@
  %7D%0A  %7D%0A%0A
+  public boolean isSoldOut(Drink drink) %7B%0A    switch (drink) %7B%0A      case COLA:%0A        return inventory%5B0%5D %3E 0;%0A      case LEMON_LIME:%0A        return inventory%5B1%5D %3E 0;%0A      case WATER:%0A        return inventory%5B2%5D %3E 0;%0A    %7D%0A  %7D%0A%0A
 %7D%0A

Add isSoldOut function to MachineController class