Example #1
0
        //returns the yearly payment for a number of gates
        public static double GetYearlyContractPayment(Airport airport, AirportContract.ContractType type, int gates, int length)
        {
            double basePrice = 0;

            if (type == AirportContract.ContractType.Full)
                basePrice = airport.getGatePrice() * 12;

            if (type == AirportContract.ContractType.Low_Service)
                basePrice = airport.getGatePrice() * 13;

            if (type == AirportContract.ContractType.Medium_Service)
                basePrice = airport.getGatePrice() * 17;

            if (type == AirportContract.ContractType.Full_Service)
                basePrice = airport.getGatePrice() * 20;

            double lengthFactor = 100 - length;

            return gates * (basePrice * (lengthFactor / 100));
        }
        //returns the yearly payment for a number of gates
        public static double GetYearlyContractPayment(Airport airport, int gates, int length)
        {
            double basePrice = airport.getGatePrice() * 12;

            double lengthFactor = 100 - length;

            return gates * (basePrice * (lengthFactor / 100));
        }