Question
Write a program that will calculate monthly mortgage payments on a house purchase. The equation you'll want to use is
[ payment= ((rate * (1+rate)^n ) / ((1+rate)^n -1)) *L ].
There are a few changes I want to what they list above.
For consistency between everyone's programs, let's have our programs expect the following user inputs from Standard Input (the keyboard).
Loan amount
Term
Interest rate
Property tax
Insurance
Explanation / Answer
#include #include using namespace std; int main() { double monthlyPayment; double balance; double interestRate; double interestPaid; double initialBalance; double termOfLoan; double month = 1; cout.setf(ios::fixed); // These lines force currency format in output to 2 decimal pts cout.setf(ios::showpoint); cout.precision(2); cout > balance; cout > interestRate; cout > monthlyPayment; initialBalance = balance; while (interestRate >= 1) /*Converts the interest rate to a decimal if the user inputs in percentage form*/ { interestRate = interestRate / 100; } balance = balance * (1 + interestRate / 12) - monthlyPayment; cout