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