Пример #1
0
        public decimal CalculateMonthlyRepayment(LoanAmount loanAmount, decimal annualInterestRate, LoanTerm loanTerm)
        {
            var monthly = (double)annualInterestRate / 100 / 12 *
                          (double)loanAmount.Principal /
                          (1 - Math.Pow(1 + ((double)annualInterestRate / 100 / 12), -loanTerm.ToMonths()));

            return(new decimal(Math.Round(monthly, 2, MidpointRounding.AwayFromZero)));
        }
Пример #2
0
 public LoanApplication(int id,
                        LoanProduct product,
                        LoanAmount amount,
                        string applicantName,
                        int applicantAge,
                        string applicantAddress,
                        decimal applicantSalary)
 {
     Id                = id;
     _product          = product;
     _amount           = amount;
     _applicantName    = applicantName;
     _applicantAge     = applicantAge;
     _applicantAddress = applicantAddress;
     _applicantSalary  = applicantSalary;
 }
Пример #3
0
 public ProductComparer(LoanAmount loanAmount, List <LoanProduct> productsToCompare)
 {
     _loanAmount        = loanAmount;
     _productsToCompare = productsToCompare;
 }