Exemplo n.º 1
0
        static void Main(string[] args)
        {
            BlackCoffee blackCoffee = new BlackCoffee();

            Console.WriteLine(blackCoffee.GetDescription());

            MilkCoffee milkCoffee = new MilkCoffee(blackCoffee);

            Console.WriteLine(milkCoffee.GetDescription());

            MilkShake milkShake = new MilkShake(milkCoffee);

            Console.WriteLine(milkShake.GetDescription());

            Console.ReadLine();
        }
Exemplo n.º 2
0
        static void Main(string[] args)
        {
            SimpleCoffee simpleCoffee = new SimpleCoffee();

            Console.WriteLine(simpleCoffee.GetDescription());
            Console.WriteLine("Cost: " + simpleCoffee.GetCost());
            Console.ReadKey();

            MilkCoffee milkCoffee = new MilkCoffee(simpleCoffee);

            Console.WriteLine(milkCoffee.GetDescription());
            Console.WriteLine("Cost: " + milkCoffee.GetCost());
            Console.ReadKey();

            MilkShake milkShake = new MilkShake(milkCoffee);

            Console.WriteLine(milkShake.GetDescription());
            Console.WriteLine("Cost: " + milkShake.GetCost());
            Console.ReadKey();
        }