Пример #1
0
        //returns the discount factor for a manufactorer for an airline and for a period
        public static double GetAirlineManufactorerDiscountFactor(Airline airline, int length, Boolean forReputation)
        {
            double score = 0;

            if (forReputation)
                score = 0.3 * (1 + (int)airline.getReputation());
            else
                score = 0.005 * (1 + (int)airline.getValue());

            double discountFactor = (Convert.ToDouble(length) / 20) + (score);
            double discount = Math.Pow(discountFactor, 5);

            if (discount > 30)
                discount = length * 3;

            return discount;


        }