Create a program that calculate the amount of a mortgagepayment. Refer to the appropriate video or any online source forhow the mathematics of the calculation works. If given these threethings:
- The amount of the loan in whole dollars
- The number of payments (e.g. 360 for 30-year)
- The interest rate per payment period in percent ( a positivefloating-point number)
The program should print out the correct value (in dollars andcents) of the per-period payment of principal and interest (ignoreescrow accounts, taxes, and insurance) for the followingscenarios:
- 72 month loan of $20,000, 4.4% APR, compoundedmonthly
- 30 year loan of $150,000, 5% APR, one annualpayment each year for 30 years
I am confused with the math behind finding the amount ofa mortgage payment. Please explain the calculations behind the twoabove given scenarios.