Example #1
0
        static void Main()
        {
            Beverage beverage = new Espresso("tall");

            beverage = new Mocha(beverage);
            beverage = new Soy(beverage);
            Console.WriteLine(beverage.Description() + " = " + beverage.Cost());

            Beverage beverage2 = new Espresso("tadll");
            beverage2 = new Mocha(beverage2);
            beverage2 = new Soy(beverage2);

            Console.WriteLine(beverage2.Description() + " = " + beverage2.Cost());

            Application.EnableVisualStyles();
            Application.SetCompatibleTextRenderingDefault(false);
            Application.Run(new Form1());
        }
Example #2
0
        static void PrintAllPricesForBeverage(Beverage beverage)
        {
            var withMocha = new Mocha(beverage);

            var withWhip         = new Whip(beverage);
            var withMochaAndWhip = new Whip(withMocha);

            var withSoy                = new Soy(beverage);
            var withSoyAndWhip         = new Soy(withWhip);
            var withSoyAndMocha        = new Soy(withMocha);
            var withMochaAndWhipAndSoy = new Soy(withMochaAndWhip);

            Console.WriteLine($"-> {withMocha.GetDescription()}: {withMocha.Cost()}");
            Console.WriteLine($"-> {withWhip.GetDescription()}: {withWhip.Cost()}");
            Console.WriteLine($"-> {withMochaAndWhip.GetDescription()}: {withMochaAndWhip.Cost()}");
            Console.WriteLine($"-> {withSoy.GetDescription()}: {withSoy.Cost()}");
            Console.WriteLine($"-> {withSoyAndWhip.GetDescription()}: {withSoyAndWhip.Cost()}");
            Console.WriteLine($"-> {withSoyAndMocha.GetDescription()}: {withSoyAndMocha.Cost()}");
            Console.WriteLine($"-> {withMochaAndWhipAndSoy.GetDescription()}: {withMochaAndWhipAndSoy.Cost()}");
        }
        static void Main(string[] args)
        {
            Beverage beverage = new Espresso();

            Console.WriteLine($"{beverage.GetDescription()} ${beverage.Cost()}");

            Beverage beverage1 = new Decat();

            beverage1 = new Mocha(beverage1);
            beverage1 = new Mocha(beverage1);
            beverage1 = new Whip(beverage1);
            Console.WriteLine($"{beverage1.GetDescription()} ${beverage1.Cost()}");

            Beverage beverage2 = new HouseBlend();

            beverage2 = new Soy(beverage2);
            beverage2 = new Mocha(beverage2);
            beverage2 = new Whip(beverage2);
            Console.WriteLine($"{beverage2.GetDescription()} ${beverage2.Cost()}");
        }
        public static void MakeSomeCoffee()
        {
            Beverage beverage = new Espresso();

            Console.WriteLine($"{beverage.GetDescription()} ${beverage.Cost()}");

            Beverage darkRoast = new DarkRoast();

            darkRoast = new Mocha(darkRoast);
            darkRoast = new Mocha(darkRoast);
            darkRoast = new Whip(darkRoast);
            Console.WriteLine($"{darkRoast.GetDescription()} ${darkRoast.Cost()}");

            Beverage houseBlend = new HouseBlend();

            houseBlend.SetSize(Size.VENTI);
            houseBlend = new Soy(houseBlend);
            houseBlend = new Mocha(houseBlend);
            houseBlend = new Whip(houseBlend);
            Console.WriteLine($"{houseBlend.GetDescription()} ${houseBlend.Cost()}");
        }
Example #5
0
File: Program.cs Project: JvPost/DP
        static void Main(string[] args)
        {
            Beverage bev1 = new Espresso();

            Print(bev1);

            Beverage bev2 = new DarkRoast();

            bev2 = new Mocha(bev2);
            bev2 = new Mocha(bev2);
            bev2 = new Whip(bev2);
            Print(bev2);

            Beverage bev3 = new HouseBlend();

            bev3 = new Soy(bev3);
            bev3 = new Mocha(bev3);
            bev3 = new Whip(bev3);
            Print(bev3);

            Console.ReadKey();
        }
Example #6
0
        static void Main()
        {
            Console.WriteLine();

            Beverage beverage = new Espresso();

            Console.WriteLine(beverage.Description() + " $" + beverage.Cost());

            Beverage beverage2 = new DarkRoast();

            beverage2 = new Mocha(beverage2);
            beverage2 = new Mocha(beverage2);
            beverage2 = new Whip(beverage2);
            Console.WriteLine(beverage2.Description() + " $" + beverage2.Cost());

            Beverage beverage3 = new HouseBlend();

            beverage3 = new Soy(beverage3);
            beverage3 = new Mocha(beverage3);
            beverage3 = new Whip(beverage3);
            Console.WriteLine(beverage3.Description() + " $" + beverage3.Cost());
        }
Example #7
0
        static void Main(string[] args)
        {
            Beverage beverage = new Espresso();

            Console.WriteLine("Description: {0} \r\n Coast: {1}", beverage.GetDescription(), beverage.Coast());

            Beverage beverage2 = new DarkRoast();

            beverage2 = new Mocha(beverage2);
            beverage2 = new Mocha(beverage2);
            beverage2 = new Whip(beverage2);
            Console.WriteLine("Description: {0} \r\n Coast: {1}", beverage2.GetDescription(), beverage2.Coast());

            Beverage beverage3 = new HouseBlend();

            beverage3 = new Soy(beverage3);
            beverage3 = new Mocha(beverage3);
            beverage3 = new Whip(beverage3);
            Console.WriteLine("Description: {0} \r\n Coast: {1}", beverage3.GetDescription(), beverage3.Coast());

            Console.ReadKey();
        }
Example #8
0
        static void Main(string[] args)
        {
            Console.WriteLine("C# StarbuzzCoffe");

            Beverage beverage = new Expresso();

            Console.WriteLine(beverage.GetDescription() + " $" + beverage.GetCost());

            Beverage beverage2 = new DarkRoast();

            beverage2 = new Mocha(beverage2);
            beverage2 = new Mocha(beverage2);
            beverage2 = new Whip(beverage2);
            Console.WriteLine(beverage2.GetDescription() + " $" + beverage2.GetCost());

            Beverage beverage3 = new HouseBlend();

            beverage3 = new Soy(beverage3);
            beverage3 = new Mocha(beverage3);
            beverage3 = new Whip(beverage3);
            Console.WriteLine(beverage3.GetDescription() + " $" + beverage3.GetCost());
        }
Example #9
0
        static void Main(string[] args)
        {
            Beverage beverage1 = new Espresso();

            Console.WriteLine("{0} costs {1}$", beverage1.GetDescription(), beverage1.cost());

            Beverage beverage2 = new DarkRoast();

            beverage2 = new Milk(beverage2);
            beverage2 = new Mocha(beverage2);
            beverage2 = new Whip(beverage2);
            beverage2.GetDescription();
            Console.WriteLine("{0} costs {1}$", beverage2.GetDescription(), beverage2.cost());

            Beverage beverage3 = new Decaf();

            beverage3.setSize(Beverage.Size.Venti);
            beverage3 = new Soy(beverage3);
            beverage3 = new Whip(beverage3);
            Console.WriteLine("{0} costs {1}$", beverage3.GetDescription(), beverage3.cost());

            Console.ReadLine();
        }
Example #10
0
        static void Main(string[] args)
        {
            Beverage beverage = new Espresso();

            beverage = new Mocha(beverage);
            Console.WriteLine(beverage.GetDescription() + ", $" + beverage.GetCost());

            Beverage beverage2 = new DarkRoast();

            beverage2 = new Mocha(beverage2);
            beverage2 = new Mocha(beverage2);
            beverage2 = new Whip(beverage2);
            Console.WriteLine(beverage2.GetDescription() + ", $" + beverage2.GetCost());

            Beverage beverage3 = new HouseBlend();

            beverage3 = new Soy(beverage3);
            beverage3 = new Mocha(beverage3);
            beverage3 = new Whip(beverage3);
            Console.WriteLine(beverage3.GetDescription() + ", $" + beverage3.GetCost());

            Console.ReadLine();
        }
        public static void Main()
        {
            Beverage beverage = new Expresso();

            Console.WriteLine(beverage.ToString());

            Beverage beverage2 = new DarkRoast();

            beverage2 = new Mocha(beverage2);
            beverage2 = new Mocha(beverage2);
            beverage2 = new Whip(beverage2);
            Console.WriteLine(beverage2.ToString());

            Beverage beverage3 = new HouseBlend
            {
                Size = BeverageSize.Venti
            };

            beverage3 = new Soy(beverage3);
            beverage3 = new Mocha(beverage3);
            beverage3 = new Whip(beverage3);
            Console.WriteLine(beverage3.ToString());
        }
Example #12
0
        static void Main(string[] args)
        {
            System.Console.WriteLine("woof!");

            Beverage my_bev = new Espresso(Beverage.bev_size.VENTI);
            System.Console.WriteLine("my_bev[" + my_bev.getDescription() + "]");
            System.Console.WriteLine("my_bev.cost[" + my_bev.cost() + "]");

            my_bev = new Mocha(my_bev);
            System.Console.WriteLine("my_bev[" + my_bev.getDescription() + "]");
            System.Console.WriteLine("my_bev.cost[" + my_bev.cost() + "]");
            
            my_bev = new Mocha(my_bev);
            System.Console.WriteLine("my_bev[" + my_bev.getDescription() + "]");
            System.Console.WriteLine("my_bev.cost[" + my_bev.cost() + "]");

            my_bev = new Soy(my_bev);
            System.Console.WriteLine("my_bev[" + my_bev.getDescription() + "]");
            System.Console.WriteLine("my_bev.cost[" + my_bev.cost() + "]");

            my_bev = new Whip(my_bev);
            System.Console.WriteLine("my_bev[" + my_bev.getDescription() + "]");
            System.Console.WriteLine("my_bev.cost[" + my_bev.cost() + "]");

            my_bev = new Whip(my_bev);
            System.Console.WriteLine("my_bev[" + my_bev.getDescription() + "]");
            System.Console.WriteLine("my_bev.cost[" + my_bev.cost() + "]");

        }