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

Write a fonction that t B Two deme -S2FDownloads%2FProject2- summer2018 (1 )%2Ez

ID: 3920177 • Letter: W

Question

Write a fonction that t B Two deme -S2FDownloads%2FProject2- summer2018 (1 )%2Ezipod778aeb02b08b3909290bf7de4bd3 hpmdnddgoe In this project, you will write a program that analyzes mortgage loan payments. A mortgage loan is usually taken to buy a house but a loan with similar terms applies for buying cars. The goal of this is project to allow the user to analyze the payments such as the monthly payment and the total interest paid. Another aspect is that the borrower is allowed to make extra payments towards the capital. This allows the loan to be paid earlier and the total amount of interest to be reduced. The program will let the user analyze such scenarios The parameters of the loan are shown in the table below Definition Example Loan Parameters Loan amount (the principal) Interest rate Term $150,000 Amount borrowed from the bank Interest charged yearly Time duration until the loan is paid back 15 years (180 months) 4% The nominal interest rate (e g: 496) is a yearly interest rate. This rate is divided by 12 to get the monthly interest rate. Therefore, the monthly interest rate is 412 033%. This means the bank charges 0.33% on the outstanding capital amount each month For example, for the first month, the outstanding amount is $150,000. Accordingly, the borrower is charged 0.33 % * S150.000-S495. In later months, the remaining capital goes down. Let's say after a few years of paying, the outstanding capital is S 100,000. For that month, the borrower is charged 0.33% * 100,000- $330 of interest. Accordingly, we can see that the amount of interest paid goes down as the borrower progresses in making the payments The magic of loan arithmetic is to have the borrower pay a fixed monthly amount over the lifetime of the loan. This amount is derived by the equation below. The term L is the total loan amount. The term m rate is the monthly interest rate (0.33% in our example). The term months is the total loan duration in months (180 months in our example)

Explanation / Answer

#include<stdio.h>
#include<math.h>

void output_short(double loan_amount,double intrest_rate,double term_years){

   printf("--------------------------------- ");
   printf("          LOAN TERMS              ");
   printf("--------------------------------- ");

   printf("%-20s %.2f ","Loan Amount:",loan_amount);
   printf("%-20s %.2f % ","Intrest Rate:",intrest_rate);
   printf("%-20s %.2f ","Term:",term_years);
   printf("--------------------------------- ");

  
  
   int n = term_years * 12;
   double m = (loan_amount * pow((1+intrest_rate/1200.0),n) * (intrest_rate/1200.0))/ (pow((1+intrest_rate/1200.0),n)-1);
   double total = m * term_years * 12;
   double intrest = total - loan_amount;
   printf("%-20s %-10.2f ","Monthly Payment is:",m);
   printf("%-20s %-10.2f ","Total Intrest is:",intrest);
   printf("%-20s %-10.2f ","Total amount paid:",total);
  
}

int main(){

   double loan;
   double intr;
   double years;

   printf("Enter loan amount :");
   scanf("%lf",&loan);
   printf("Enter intrest rate :");
   scanf("%lf",&intr);
   printf("Enter number of years :");
   scanf("%lf",&years);

   output_short(loan,intr,years);
}

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