Question: / Mortgage Payment Calculator program // This program determines the monthly payments on a // mortgage given the loan amount, the yearly interest, // and
/ Mortgage Payment Calculator program // This program determines the monthly payments on a // mortgage given the loan amount, the yearly interest, // and the number of years. //*************************************************** #include// Access cout #include // Access power function #include // Access manipulators using namespace std; const float LOAN_AMOUNT = 50000.00; // Amount of loan const float YEARLY_INTEREST = 0.0524;// Yearly interest const int NUMBER_OF_YEARS = 7; // Number of years float monthlyInterest; // Monthly interest rate int numberOfPayments; // Total number of payments float payment; // Monthly payment int main() { // Calculate values monthlyInterest = YEARLY_INTEREST / 12; numberOfPayments = NUMBER_OF_YEARS * 12; payment =(LOAN_AMOUNT * pow(monthlyInterest + 1, numberOfPayments) * monthlyInterest)/(pow(monthlyInterest + 1, numberOfPayments) - 1); // Output results cout << fixed << setprecision(2) << "For a loan amount of " << LOAN_AMOUNT << " with an interest rate of " << YEARLY_INTEREST << " and a " << NUMBER_OF_YEARS << " year mortgage, " << endl; cout << " your monthly payments are $" << payment << "." << endl; return 0; }
identify at least four (non-comment related) improvements that could be made, describing how the change would be an improvement. IN C++
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
