Ejemplo n.º 1
0
        public void getOrder(String factoryType)
        {
            if (factoryType.ToLower() == "waffle")
            {
                Console.WriteLine(waffleType + " order received.");

                WaffleFactory factory = new WaffleFactory();
                waffle = factory.makeWaffle(waffleType);

                waffle.prepareDough(waffleType);
                waffle.cookDough(waffleType);
                waffle.dishUp(waffleType);
                waffle = decorate(chocoList, fruitList, condimentList);

                Console.WriteLine(waffle.getDescription() + " order completed.");
                Console.WriteLine("Cost: $" + waffle.cost());
            }
            else if (factoryType.ToLower() == "beverage")
            {
                Console.WriteLine(beverageType + " order received.");

                BeverageFactory factory = new BeverageFactory();
                beverage = factory.makeBeverage(beverageType);
                beverage.prepareBeverage();

                Console.WriteLine(beverage.getDescription() + " order completed.");
                Console.WriteLine("Cost: $" + beverage.cost());
            }
            Console.WriteLine("");
        }
Ejemplo n.º 2
0
 public override double cost()
 {
     return(0.60 + waffle.cost());
 }
Ejemplo n.º 3
0
 public override double cost()
 {
     return(2.5 + waffle.cost());
 }