Esempio n. 1
0
        static void Main(string[] args)
        {
            IVehicle honda = new HondaVehicle();

            Console.WriteLine("Before Discount:{0}", honda.Price);

            SpecialOffer offer = new SpecialOffer(honda);

            offer.discountedPercentage = 10;
            Console.WriteLine("After Discount:{0}", offer.DiscountedPrice());
            Console.ReadKey();
        }
Esempio n. 2
0
        static void Main(string[] args)
        {
            var personelCar = new PersonelCar {
                Make = "BMW", Model = "3.20", HirePrice = 2500
            };
            SpecialOffer specialOffer = new SpecialOffer(personelCar);

            specialOffer.DiscountPercentage = 10;

            Console.WriteLine("Concrete : {0}", personelCar.HirePrice);
            Console.WriteLine("Special offer : {0}", specialOffer.HirePrice);

            Console.ReadLine();
        }
Esempio n. 3
0
        static void Main(string[] args)
        {
            // Basic vehicle
            HondaCity car = new HondaCity();

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

            // Special offer
            SpecialOffer offer = new SpecialOffer(car) {DiscountPercentage = 25, Offer = "25 % discount"};

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

            Console.ReadKey();
        }