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)
            {
            }
        }
Ejemplo n.º 2
0
        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();
        }