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

Students in Miss Moseley's fourth grade class are learning multiplication, and they demonstrate mastery by passing assessments. Travis has passed 11 tests, and
A basic position in American foreign policy has been that America must defend its foreign interests related to trade and security. The main foreign policy posit
I don't not understand substation for this problem y=x+6 then y=2x-7
How do decomposers interact with their ecosystem? Be sure to name one example of them taking from the ecosystem and one example of them giving to the ecosystem.
Which of the following is true of fertilization in conifers? (2 points) The female cone releases its seeds and new gametophytes grow. The male cone releases its
How did expansion and global trade during the 15th to 18th centuries affect the politics of european countries A: many governments legalized trade monopolies an
Which are characteristics of life in Athens but not Sparta? Choose all answers that are correct. A. openness to new ideas B. emphasis on military education C. u
What was the main and initial conflict that propelled prohibition? A. A clash between urban and country values B. African-American citizens' desire to be free f
What do the Indian rulers Babur, Akbar, and Shah Jahan have in common? A.They were all rulers during the Mogul Dynasty. B.They all gained power by conquest. C.T
Which sentence contains the correct homophone? Please rase an objection if you have a problem. Please raze an objection if you have a problem. Please raise an o
,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

Students in Miss Moseley's fourth grade class are learning multiplication, and they demonstrate mastery by passing assessments. Travis has passed 11 tests, and
A basic position in American foreign policy has been that America must defend its foreign interests related to trade and security. The main foreign policy posit
I don't not understand substation for this problem y=x+6 then y=2x-7
How do decomposers interact with their ecosystem? Be sure to name one example of them taking from the ecosystem and one example of them giving to the ecosystem.
Which of the following is true of fertilization in conifers? (2 points) The female cone releases its seeds and new gametophytes grow. The male cone releases its
How did expansion and global trade during the 15th to 18th centuries affect the politics of european countries A: many governments legalized trade monopolies an
Which are characteristics of life in Athens but not Sparta? Choose all answers that are correct. A. openness to new ideas B. emphasis on military education C. u
What was the main and initial conflict that propelled prohibition? A. A clash between urban and country values B. African-American citizens' desire to be free f
What do the Indian rulers Babur, Akbar, and Shah Jahan have in common? A.They were all rulers during the Mogul Dynasty. B.They all gained power by conquest. C.T
Which sentence contains the correct homophone? Please rase an objection if you have a problem. Please raze an objection if you have a problem. Please raise an o