public List <Sugar> SellSugar(int itemsBeingSold, Bank bank) { List <Sugar> newSugar = new List <Sugar>(); Sugar sugar = new Sugar(); if (itemsBeingSold != 20) { for (int i = 0; i < itemsBeingSold; i++) { if (bank.SubtractMoney(sugar.GetCost())) { newSugar.Add(new Sugar()); } } } else if (bank.SubtractMoney(sugar.GetBulkCost())) { for (int i = 0; i < itemsBeingSold; i++) { newSugar.Add(new Sugar()); } } return(newSugar); }
public double NumberOfSugarPurchased(int NumberOfSugarNeeded) { Sugar sugar = new Sugar(); checkOutSugar = sugar.GetCost() * NumberOfSugarNeeded; return(checkOutSugar); }