Example #1
0
  /**
   * @param itemCode Item Code of the Food Item which is to be bought
   * @param amount Amount entered for buying the Food Item
   * @return change
   *     <p>This method calls the 'BuyItemWithCash' method in the VendingMachine class.
   */
  public double BuyFoodItemWithCash(int itemCode, double amount) {
    double change;

    VendingMachine machine = parentUI.getVendingMachine();
    change =
        machine.BuyItemWithCash(itemCode, amount); // Call to the method in Vending Machine Class

    return change;
  }