Beispiel #1
0
            /// <summary>
            /// Entry point into console application.
            /// </summary>
            public static void Main()
            {
                // 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.Display();

                // Wait for user

                Console.ReadKey();
            }
Beispiel #2
0
        static void Main(string[] args)
        {
            // Example 1

            // Basic vehicle
            HondaCity car = new HondaCity();

            Console.WriteLine("Honda City base price are : {0}", car.Price);

            // Special offer
            SpecialOffer offer = new SpecialOffer(car);

            offer.DiscountPercentage = 25;
            offer.Offer = "25 % discount";

            Console.WriteLine("{1} @ Diwali Special Offer and price are : {0} ", offer.Price, offer.Offer);

            // Example 2

            // 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.Display();
        }