public static void Run() { Beverage beverage = new Espresso(); Console.WriteLine(beverage.description + " $" + beverage.cost()); Console.WriteLine(); Beverage beverage2 = new DarkRoast(); beverage2 = new Mocha(beverage2); beverage2 = new Mocha(beverage2); beverage2 = new Whip(beverage2); Console.WriteLine(beverage2.description + " $" + beverage2.cost()); Console.WriteLine(); Beverage beverage3 = new HouseBlend(); beverage3 = new Soy(beverage3); beverage3 = new Mocha(beverage3); beverage3 = new Whip(beverage3); Console.WriteLine(beverage3.description + " $" + beverage3.cost()); Console.WriteLine(); Beverage beverage4 = new HouseBlend(); beverage4.size = Beverage.Size.GRANDE; Console.WriteLine("Setting size to: {0}", beverage4.size); beverage4 = new Soy(beverage4); beverage4 = new Mocha(beverage4); beverage4 = new Whip(beverage4); Console.WriteLine(beverage4.description + " $" + beverage4.cost()); Console.WriteLine(); Beverage beverage5 = new HouseBlend(); beverage5.size = Beverage.Size.TALL; Console.WriteLine("Setting size to: {0}", beverage5.size); beverage5 = new Soy(beverage5); beverage5 = new Mocha(beverage5); beverage5 = new Whip(beverage5); Console.WriteLine(beverage5.description + " $" + beverage5.cost()); Console.WriteLine(); Beverage beverage6 = new HouseBlend(); beverage6.size = Beverage.Size.VENTI; Console.WriteLine("Setting size to: {0}", beverage6.size); beverage6 = new Soy(beverage6); beverage6 = new Mocha(beverage6); beverage6 = new Whip(beverage6); Console.WriteLine(beverage6.description + " $" + beverage6.cost()); Console.WriteLine(); Console.ReadKey(); }
static void Main(string[] args) { Beverage beverage = new Espresso(); System.Console.WriteLine(beverage.getDescription() + " $" + beverage.cost()); Beverage beverage2 = new DarkRoast(); beverage2 = new Mocha(beverage2); beverage2 = new Mocha(beverage2); beverage2 = new Whip(beverage2); System.Console.WriteLine(beverage2.getDescription() + " $" + beverage2.cost()); }
static void Main(string[] args) { Beverage beverage = new Espresso(); Console.WriteLine(beverage.getDescription() + beverage.cost()); Beverage beverage2 = new HouseBlend(); beverage2 = new Mocha(beverage2); beverage2 = new Soya(beverage2); Console.WriteLine(beverage2.getDescription() + beverage2.cost()); Console.ReadLine(); }
static void Main(string[] args) { Beverage essp = new Espresso(); Console.WriteLine(essp.GetDiscription() + "\t" + essp.cost().ToString()); Beverage houseB = new HouseBlend(); Console.WriteLine(houseB.GetDiscription() + "\t" + houseB.cost().ToString()); essp = new Whip(essp); Console.WriteLine(essp.GetDiscription() + "\t" + essp.cost().ToString()); essp = new SteamMilk(essp); Console.WriteLine(essp.GetDiscription() + "\t" + essp.cost().ToString()); houseB = new Soy(houseB); Console.WriteLine(houseB.GetDiscription() + "\t" + houseB.cost().ToString()); // Create book Book book = new Book("Worley", "Inside ASP.NET", 10); book.Display(); // Create video Video video = new Video("Spielberg", "Jaws", 23, 92); video.Display(); // Make video borrowable, then borrow and display Console.WriteLine("\nMaking video borrowable:"); Borrowable borrowvideo = new Borrowable(video); borrowvideo.BorrowItem("Customer #1"); borrowvideo.BorrowItem("Customer #2"); borrowvideo.BorrowItem("Customer #3"); borrowvideo.Display(); borrowvideo.ReturnItem("Customer #1"); borrowvideo.ReturnItem("Customer #2"); borrowvideo.Display(); // Wait for user Console.ReadKey(); while (true) { } }
public static void Test() { 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()); }
static void Main(string[] args) { Beverage bev = new Espresso(); Console.WriteLine(bev.GetDescription() + "- $" + bev.cost()); Beverage bev2 = new DarkRoast(); bev2 = new Soy(bev2); bev2 = new Mocha(bev2); bev2 = new Soy(bev2); Console.WriteLine(bev2.GetDescription() + " - $" + bev2.cost()); Beverage bev3 = new HouseBlend(); bev3 = new Soy(bev3); bev3 = new Mocha(bev3); bev3 = new Whip(bev3); bev3 = new Soy(bev3); bev3 = new Whip(bev3); Console.WriteLine(bev3.GetDescription() + " - $" + bev3.cost()); Console.ReadKey(); }