public bool Dispense(ProductType productType) { switch (productType) { case ProductType.Cola: { bool colaDispensed = cola.Dispense(); return(colaDispensed); } case ProductType.Chips: { bool chipsDispensed = chips.Dispense(); return(chipsDispensed); } case ProductType.Candy: { bool candyDispensed = candy.Dispense(); return(candyDispensed); } default: return(false); } }