Academic Integrity: tutoring, explanations, and feedback — we don’t complete graded work or submit on a student’s behalf.

1)Modify the program Amortize by inserting a function FindPayment( ) that will c

ID: 3632151 • Letter: 1

Question

1)Modify the program Amortize by inserting a function FindPayment( ) that will compute the monthly payment. The modified program should appear as follows:

#include <iostream>
#include <iomanip>
#include <cmath>
using namespace std;

/***** Function prototype goes here ******/

//Program name: Amortize
int main(void)
{
double Amount, Rate, Payment, Z;
int Years, NoPayment;
cout<<"Enter the borrowed amount --->";
cin>>Amount;
cout<<endl<<"Enter the annual interest rate (%) --->";
cin>>Rate;
cout<<endl<<"Enter the pay-back period (in years) --->";
cin>>Years;
/******These statements compute the monthly payment*****/
Payment = FindPayment (Amount, Rate, Year);
/*******************************************************/
cout<<endl;
cout<<setprecision(2)<<fixed<<showpoint;
cout<<"The monthly payment is $"<<Payment<<endl;
cin.get(); cin.get();
return 0;
} // Amortize


/*****Insert function definition for FindPayment( ) here*****/

Explanation / Answer

float Findpayment(Amount, Rate, Year)
{
float payment;
payment = Amount + Amount*Rate*(Year/12) ;   /**** year/12 because for one month ie required and                                                                                          payment = amount + interest where interest for one                                                                                    month is  Amount*Rate*(Year/12) ****
return payment;
}