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

Write a function that takes the loan terms as input and prints the monthly payme

ID: 3918466 • Letter: W

Question

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: Interest Rate Term: 150000 4.00% 15 years Monthly payment is: Total interest is: 1109.53 49715.74 Total amount paid is: 199715.74

Explanation / Answer

Note: Almost i did it.But the doubt is dowe have to ask the user about the monthlt payment.Could u plz clarify.SO that i will complete the calculation part..

________________

#include <stdio.h>

#include <string.h>

void output_short_format(double loanAmt,double rate,double term);

int main()

{

double loanAmt,rate;

double term;

printf("Enter Loan Amount :");

scanf("%lf",&loanAmt);

printf("Enter Interest Rate :");

scanf("%lf",&rate);

printf("Enter term years :");

scanf("%lf",&term);

  

output_short_format(loanAmt,rate,term);

return 0;

}

void output_short_format(double loanAmt,double rate,double term)

{

double totInterest=0,totAmt=0,monthlyPayment=0;

printf("------------------------------------------- ");

printf(" LOAN TERMS ");

printf("------------------------------------------- ");

printf("Loan Amount: %.lf ",loanAmt);

printf("Interest Rate: %.2lf %% ",rate);

printf("Term: %.lf Years ",term);

totInterest=term*(rate/1200)*loanAmt;

totAmt=loanAmt+totInterest;

monthlyPayment=(totAmt/(term*12));

printf(" Monthly payment is: %.2lf ",monthlyPayment);

printf("Total interest is: %.2lf ",totInterest);

printf("Total amount paid is: %.2lf ",totAmt);

}

_____________

Hire Me For All Your Tutoring Needs
Integrity-first tutoring: clear explanations, guidance, and feedback.
Drop an Email at
drjack9650@gmail.com
Chat Now And Get Quote