Example #1
0
        static void Main(string[] args)
        {
            Beverage beverage = new Espresso();

            beverage.setBeverageSize(BeverageSize.AVERAGE);
            Console.WriteLine(beverage.getDescription() + " $" + beverage.cost());

            Beverage beverage2 = new DarkRoast();

            //beverage2.setBeverageSize(BeverageSize.BIG);
            //beverage2 = new Mocha(beverage2);
            //beverage2.setBeverageSize(BeverageSize.BIG);
            //beverage2 = new Whip(beverage2);
            //beverage2.setBeverageSize(BeverageSize.BIG);
            Console.WriteLine(beverage2.getDescription() + " $" + beverage2.cost());

            Beverage beverage3 = new HouseBlend();

            beverage3.setBeverageSize(BeverageSize.BIG);
            beverage3 = new Soy(beverage3);
            beverage3.setBeverageSize(BeverageSize.BIG);
            beverage3 = new Mocha(beverage3);
            beverage3.setBeverageSize(BeverageSize.BIG);
            beverage3 = new Whip(beverage3);
            beverage3.setBeverageSize(BeverageSize.BIG);
            Console.WriteLine(beverage3.getDescription() + " $" + beverage3.cost());
            Console.ReadKey();
        }
        static void Main(string[] args)
        {
            Beverage beverage = new Espresso();

            Console.WriteLine($"{beverage.getDescription()} ${beverage.cost()}");
            Beverage beverageEspresso = new Espresso();

            beverageEspresso = new Mocha(beverageEspresso);
            beverageEspresso = new Mocha(beverageEspresso);
            beverageEspresso = new Whip(beverageEspresso);
            Console.WriteLine($"{beverageEspresso.getDescription()} ${beverageEspresso.cost()}");
            Beverage beverageHouseBlend = new HouseBlend();

            beverageHouseBlend = new Mocha(beverageHouseBlend);
            beverageHouseBlend = new Mocha(beverageHouseBlend);
            beverageHouseBlend = new Whip(beverageHouseBlend);
            Console.WriteLine($"{beverageHouseBlend.getDescription()} ${beverageHouseBlend.cost()}");
            Console.ReadKey();
        }
Example #3
0
        static void Main(string[] args)
        {
            Beverage beverage = new Espresso();

            Console.WriteLine(beverage.getDescription() + " $" + beverage.cost());

            Beverage beverage2 = new DarkRoast();

            beverage2 = new Mocha(beverage2);
            beverage2 = new Mocha(beverage2);
            beverage2 = new Whip(beverage2);
            Console.WriteLine(beverage2.getDescription() + " $" + beverage2.cost());

            Beverage beverage3 = new HouseBlend();

            beverage3 = new Soy(beverage3);
            beverage3 = new Mocha(beverage3);
            beverage3 = new Whip(beverage3);
            Console.WriteLine(beverage3.getDescription() + " $" + beverage3.cost());
        }
Example #4
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() + "]");

        }