Exemplo n.º 1
0
        public double CalculatePrice(int daysRented, Customer customer, RentalCars office)
        {
            if (customer.FrequentRenterPoints < 3)
            {
                return(0);
            }

            double totalPrice = daysRented * basePrice;

            RentalCars.RevenuePerCategory["Luxury"] += totalPrice * office.PriceMultiplier / 2;
            return(totalPrice * office.PriceMultiplier);
        }
Exemplo n.º 2
0
        public double CalculatePrice(int daysRented, Customer customer, RentalCars office)
        {
            double totalPrice = 0;

            if (daysRented > 2)
            {
                totalPrice = basePrice * 2 + (daysRented - 2) * additionalPrice;
            }
            else
            {
                totalPrice = daysRented * basePrice;
            }

            if (customer.FrequentRenterPoints >= 5)
            {
                totalPrice *= 0.05;
            }

            RentalCars.RevenuePerCategory["Mini"] += totalPrice * office.PriceMultiplier / 2;
            return(totalPrice * office.PriceMultiplier);
        }