Implement this C program by defining a structure for each payment. The structure should have at least three members for the interest, principle and balance separately. And store all the payments in a structure array (the max size of which could be 100). Name this C program as loanCalcStruct.c. Note: . In your answer sheet, for each C program above please attach a screenshot of the output when amount of loan is $2000, interest rate per year is %7.5 and number of payment is 6. . Put the source code of each C program above into your answer sheet Upload the c file of each Cprogram above into the submission folder of iCollege.

Respuesta :

Answer:

#include<stdio.h>

#include<math.h>

void output_amortized(float loan_amount,float intrest_rate,int term_years)

{

  int i,j;                       //Month

  int payments;                   //Number of payments  

  float loanAmount;               //Loan amount

  float anIntRate;               //Yealy interest Rate

  float monIntRate;               //Monthly interest rate

  float monthPayment;           //Monthly payment

  float balance;                   //Balance due

  float monthPrinciple;           //Monthly principle paid

  float monthPaidInt;           //Month interest paid

 

  balance=loan_amount;

  //Calculations

  //Monthly interest rate

  monIntRate = ((intrest_rate/(100*12)));

  //Monthly payment

  payments=term_years;  

  monthPayment = (loan_amount * monIntRate * (pow(1+monIntRate, payments)/(pow (1+monIntRate, payments)-1)));

  monthPaidInt = balance * monIntRate;

  //Amount paid to principle

  monthPrinciple = monthPayment-monthPaidInt;

  //New balance due

  balance = balance - monthPrinciple;

 

  printf("\n\nMonthly payment should be :%.2f\n\n",monthPayment);

  printf("============================AMORTIZATION SCHEDUAL==========================\n");

  printf("#\tPayment\t\tIntrest\t\tPrinciple\t\tBalance\n");

 

  for(i=0;i<payments;i++)

  {

      printf("%d%9c%.2f%9c%.2f%16c%.2f%14c%.2f\n",(i+1),'

Otras preguntas

,monthPayment,'

Otras preguntas

,monthPaidInt,'

Otras preguntas

,monthPrinciple,'

Otras preguntas

The state of Florida passes a law requiring high school students to take an online course as a graduation requirement. This is an example of a reserved power g
Jobi is taking his children on a long drive. Jobi is making snack bags to take on the drive using 40 granola bars and 32 apples. Each bag will contain the same
Publisher Alfred Nutt published A Boy's Will in 1913 and North of Boston in 1914. is a fragment
NEED HELP FAST!!! Which best describes how the information lobbyists provide to lawmakers is significant? 1.Lobbying enables outsiders to influence government.
J.K. Rowling and R.L. Stine are both reading the hunger games. J.K. reads 35 pages every 2 hours and R.L. reads 45 pages every 3 hours. Part A: What is the rate
Germination. A. Ends with dormancy B. Is unaffected by temperature or any other conditions within the environment. C. Is the same process for both monocots and
Who made up the "Third Estate" that became the 1st French National Assembly? How did the Women's March move the conflict towards Revolution? What turned French
Choose all that state the correct unit rate for each situation. Dan earns $35 for 7 hours of work. The unit rate is $7 for 1 hour. Jenna can drive her car 110 m
What is the name of tge series of laws put in place to encourage the 13 english colonies to trade with england
Which words complete the sentence? Si vous voulez ____________ avec un bon entraîneur ________________ à un gym. A. s’entraîner, s’inscrire B. entraîne
,balance);

      monthPaidInt = balance * monIntRate;

      //Amount paid to principle

      monthPrinciple = monthPayment-monthPaidInt;

      //New balance due

      balance = balance - monthPrinciple;

  }

}

int main()

{

  float principle,rate;

  int termYear;

  printf("Enter the loan amount: $");

  scanf("%f",&principle);

  printf("Enter the intrest rate :%");

  scanf("%f",&rate);

  printf("Enter the loan duration in years: ");

  scanf("%d",&termYear);

  output_amortized(principle,rate,termYear);

}

Explanation:

see output

Ver imagen akindeleot

Otras preguntas

The state of Florida passes a law requiring high school students to take an online course as a graduation requirement. This is an example of a reserved power g
Jobi is taking his children on a long drive. Jobi is making snack bags to take on the drive using 40 granola bars and 32 apples. Each bag will contain the same
Publisher Alfred Nutt published A Boy's Will in 1913 and North of Boston in 1914. is a fragment
NEED HELP FAST!!! Which best describes how the information lobbyists provide to lawmakers is significant? 1.Lobbying enables outsiders to influence government.
J.K. Rowling and R.L. Stine are both reading the hunger games. J.K. reads 35 pages every 2 hours and R.L. reads 45 pages every 3 hours. Part A: What is the rate
Germination. A. Ends with dormancy B. Is unaffected by temperature or any other conditions within the environment. C. Is the same process for both monocots and
Who made up the "Third Estate" that became the 1st French National Assembly? How did the Women's March move the conflict towards Revolution? What turned French
Choose all that state the correct unit rate for each situation. Dan earns $35 for 7 hours of work. The unit rate is $7 for 1 hour. Jenna can drive her car 110 m
What is the name of tge series of laws put in place to encourage the 13 english colonies to trade with england
Which words complete the sentence? Si vous voulez ____________ avec un bon entraîneur ________________ à un gym. A. s’entraîner, s’inscrire B. entraîne