Ejemplo n.º 1
0
 public double totalCost(Apple apple, Orange orange)
 {
     for (int i = 0; i < items.Count; i++)
     {
         if (items[i] == apple)
         {
             amount += apple.price;
         }
         if (items[i] == orange)
         {
             amount += orange.price;
         }
     }
     return(amount);
 }
Ejemplo n.º 2
0
 public ArrayList addApple(Apple apple)
 {
     items.Add(apple);
     return(items);
 }
Ejemplo n.º 3
0
 static void Main(string[] args)
 {
     Apple    apple    = new Apple(0.6);
     Orange   orange   = new Orange(0.25);
     Checkout checkout = new Checkout(0, [apple, apple, orange]);
 }