Ejemplo n.º 1
0
        static void Main(string[] args)
        {
            Beverage beverage = new Espresso();

            Console.WriteLine(beverage.getDescription() + " $ " + beverage.cost());
            Beverage beverage2 = new HouseBlend();

            Console.WriteLine(beverage2.getDescription() + " $ " + beverage2.cost());
            beverage2 = new Mocha(beverage2);
            Console.WriteLine(beverage2.getDescription() + " $ " + beverage2.cost());
        }
Ejemplo n.º 2
0
        static void Main(string[] args)
        {
            Beverage beverage1 = new Espresso();

            Console.WriteLine("Description is: " + beverage1.getDescription());
            Console.WriteLine("Cost is: " + beverage1.cost());

            Console.WriteLine("---------------------------------------------------------");

            Beverage beverage2 = new HouseBend();

            beverage2 = new Mocha(beverage2);
            beverage2 = new Mocha(beverage2);
            beverage2 = new Soy(beverage2);
            Console.WriteLine("Description is: " + beverage2.getDescription());
            Console.WriteLine("Cost is: " + beverage2.cost());
        }