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

Please answer using C (NO C++) Write a function that takes the loan terms as inp

ID: 3912945 • Letter: P

Question

Please answer using C (NO C++)

Write a function that takes the loan terms as input and prints the monthly payment and the information
shown below. Below is the header of the function and the output for our example loan. Your function
should print all the information shown and the numbers should be right aligned.
void output_short_format(double loan_amount, double interest_rate, double
term_years);
------------------------------------------------------------------------------------
LOAN TERMS
------------------------------------------------------------------------------------
Loan Amount: 150000
Interest Rate: 4.00%
Term: 15 years
--------------------------------------------------------------------------------------
Monthly payment is: 1109.53
Total interest is: 49715.74
Total amount paid is: 199715.74

Explanation / Answer

void output_short_format(double loan_amount, double interest_rate, double
term_years){

double amount_paid, total_interest, monthly_payment;

monthly_payment = loan_amount / {[pow((1 + 0.003) ,180)] - 1} / [pow(0.003*(1 + 0.003),180)]

amount_paid = monthly_payment*term_years*12;

total_interest = amount_paid - loan_amount;

printf("%lf,%lf,%lf", monthly_payment, total_interest, total_amount);

}