Mortgage Payment Calculator

Write a program that stores the mortgage loan amount, monthly interest rate, and number of payments, and uses those values to calculate the monthly payment.

Use the following formula:

P * r (1 + r)^n P = Principal Loan amount ($) ------------------- r = Monthly Interest Rate (decimal) (1 + r)^n - 1 n = Number of Payments (months)

Requirements

  • Store the input values as variables.
  • Store the result as a variable that can contain decimals.
  • Have it display the result to 2 decimals.