Пример #1
0
        static void Main(string[] args)
        {
            var personelCar = new PersonelCar {
                Make = "BMW", Model = "3.20,", HirePrice = 2500
            };
            var specialOffer = new SpecialOffer(personelCar);

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

            Console.ReadLine();
        }
Пример #2
0
        static void Main(string[] args)
        {
            var personalCar = new PersonelCar {
                Make = "Bmw", Model = "3.20", HirePrice = 2500
            };

            SpecialOffer specialOffer = new SpecialOffer(personalCar);

            specialOffer.DiscountPercentage = 10;
            Console.WriteLine($"Concrete : {personalCar.HirePrice}");
            Console.WriteLine($"Special offer : {specialOffer.HirePrice}");


            Console.ReadLine();
        }
Пример #3
0
        static void Main(string[] args)
        {
            var personelCar = new PersonelCar
            {
                Make      = "BMW",
                Model     = "3.20",
                HirePrice = 2500
            };
            SpecialOffer specialOffer = new SpecialOffer(personelCar);

            specialOffer.DiscountPercentage = 20;

            Console.WriteLine("Concrete : " + personelCar.HirePrice);
            Console.WriteLine("Special offer : " + specialOffer.HirePrice);
            Console.ReadKey();
        }