public virtual int getCost() { return(_coffee.getCost()); }
public double getCost() { return(_coffee.getCost() + _price); }
public virtual double getCost() { // implementing methods of the interface return(decoratedCoffee.getCost()); }
private void finishCreation_Click(object sender, EventArgs e) { if (currentCoffee != null) { string desc = currentCoffee.getDescription(); if (desc.Substring(desc.Length - 5, 5) == "with ") { beveragesSoldLb.Items.Add("Sold plain " + desc.Substring(0, desc.Length - 6) + " for " + currentCoffee.getCost()); } else { beveragesSoldLb.Items.Add("Sold " + desc.Substring(0, currentCoffee.getDescription().Length - 2) + " for " + currentCoffee.getCost()); } currentCoffee = null; } else { MessageBox.Show("There is no coffee selected."); } }
public static void printCoffeeInfo(ICoffee c) { Console.WriteLine("Current Coffee: " + c.getCost() + ". Ingredients: " + c.getIngredients()); }
public virtual double getCost() { //need this since it must implement ICoffee return(decoratedCoffee.getCost()); }