public virtual int getCost()
 {
     return(_coffee.getCost());
 }
 public double getCost()
 {
     return(_coffee.getCost() + _price);
 }
Exemple #3
0
 public virtual double getCost()
 { // implementing methods of the interface
     return(decoratedCoffee.getCost());
 }
Exemple #4
0
 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.");
     }
 }
Exemple #5
0
 public static void printCoffeeInfo(ICoffee c)
 {
     Console.WriteLine("Current Coffee: " + c.getCost() + ". Ingredients: " + c.getIngredients());
 }
Exemple #6
0
 public virtual double getCost()
 {
     //need this since it must implement ICoffee
     return(decoratedCoffee.getCost());
 }