static void Main(string[] args) { Beverage beverage = new Espresso(); Console.WriteLine(beverage.GetDescription() + "$" + beverage.Cost()); Beverage beverage2 = new DarkRoast(); beverage2 = new Mocah(beverage2); beverage2 = new Mocah(beverage2); beverage2 = new Whip(beverage2); Console.WriteLine(beverage2.GetDescription() + "$" + beverage2.Cost()); Console.ReadLine(); }
static void Main(string[] args) { Beverage beverage = new Espresso(); Console.WriteLine(beverage.Description + " $" + beverage.Cost()); Beverage beverage2 = new HouseBlend(); beverage2 = new Mocha(beverage2); // add a Mocha beverage2 = new Mocha(beverage2); // add another Mocha beverage2 = new Whip(beverage2); // add a Whip Console.WriteLine(beverage2.Description + " $" + beverage2.Cost()); Console.ReadKey(); }
static void Main(string[] args) { Beverage beverage = new Espresso(); Console.WriteLine(beverage.GetDescription() + " $" + beverage.Cost()); Beverage beverage2 = new Whip(new Mocha(new Mocha(new DarkRoast()))); Console.WriteLine(beverage2.GetDescription() + " $" + beverage2.Cost()); Beverage beverage3 = new Whip(new Mocha(new Soy(new HouseBlend()))); Console.WriteLine(beverage3.GetDescription() + " $" + beverage3.Cost()); Console.ReadKey(); }
static void Main(string[] args) { var espresso = new Espresso(); Console.WriteLine(espresso.GetDescription()); Console.WriteLine(espresso.Cost()); var espressoWithChoc = new HotChocolate(espresso); Console.WriteLine(espressoWithChoc.GetDescription()); Console.WriteLine(espressoWithChoc.Cost()); var espressoWithChockAndDoubleSyrop = new MapleSyrup(new MapleSyrup(espressoWithChoc)); Console.WriteLine(espressoWithChockAndDoubleSyrop.GetDescription()); Console.WriteLine(espressoWithChockAndDoubleSyrop.Cost()); }
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()}"); }
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()}"); }
static void Main(string[] args) { BeverageBase espresso = new Espresso(); Console.WriteLine($"{espresso.GetDescription()} ${espresso.Cost()}"); BeverageBase houseBlend = new HouseBlend(); houseBlend = new Mocha(houseBlend); houseBlend = new Mocha(houseBlend); houseBlend = new WhipCream(houseBlend); Console.WriteLine($"{houseBlend.GetDescription()} ${houseBlend.Cost()}"); BeverageBase darkRoast = new DarkRoast(); darkRoast = new SoyMilk(darkRoast); darkRoast = new Mocha(darkRoast); darkRoast = new WhipCream(darkRoast); Console.WriteLine($"{darkRoast.GetDescription()} ${darkRoast.Cost()}"); Console.ReadLine(); }
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()); }
static void Main(string[] args) { Beverage beverage = new Espresso(); Console.WriteLine(beverage.GetDescription() + " $ " + beverage.Cost()); beverage = new Mocha(beverage); Console.WriteLine(beverage.GetDescription() + " $ " + beverage.Cost()); beverage = new Mocha(beverage); Console.WriteLine(beverage.GetDescription() + " $ " + beverage.Cost()); beverage = new Whip(beverage); Console.WriteLine(beverage.GetDescription() + " $ " + beverage.Cost()); beverage.size = Size.Larger; Console.WriteLine(beverage.GetDescription() + " $ " + beverage.Cost()); beverage.size = Size.Middle; Console.WriteLine(beverage.GetDescription() + " $ " + beverage.Cost()); beverage.size = Size.Small; Console.WriteLine(beverage.GetDescription() + " $ " + beverage.Cost()); }