1answer.
Ask question
Login Signup
Ask question
All categories
  • English
  • Mathematics
  • Social Studies
  • Business
  • History
  • Health
  • Geography
  • Biology
  • Physics
  • Chemistry
  • Computers and Technology
  • Arts
  • World Languages
  • Spanish
  • French
  • German
  • Advanced Placement (AP)
  • SAT
  • Medicine
  • Law
  • Engineering
Alexus [3.1K]
3 years ago
6

Implement this C program by defining a structure for each payment. The structure should have at least three members for the inte

rest, 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.

Engineering
1 answer:
Klio2033 [76]3 years ago
6 0

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),'$',monthPayment,'$',monthPaidInt,'$',monthPrinciple,'$',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

You might be interested in
Which line from "On Becoming an Inventor" supports the idea that Dean's time at Worcester Polytechnic Institute was very useful
Stolb23 [73]

Answer:

Explanation:

The line from "On becoming an inventor" that says:

"I found that at college I could get help from my teachers with solving business problems and in learning new techniques for designing new things"

On Becoming an Inventor was by Dean Kamen an American Engineer, Inventor and Businessman

3 0
3 years ago
Read 2 more answers
Which type of system is being researched to deliver power to several motors to drive multiple systems in vehicles?
qaws [65]

Answer:

pneumatic power system

Explanation:

pneumatic power can be used to quietly operate power windows, door locks, power mirrors, and much much more, also negative pressure pneumatics (vacuum) is used to control many engine and fuel systems

8 0
2 years ago
A ruptured desiccant bag in a reciever-driver is usually caused by what?​
ollegr [7]

Answer: Bad A/C

Explanation: ...

4 0
2 years ago
Select the correct answer.
Genrish500 [490]
A is the correct answer
5 0
2 years ago
Which two is right about febuary 14
igor_vitrenko [27]

Answer:A and B

Explanation:

3 0
3 years ago
Read 2 more answers
Other questions:
  • A surveyor is trying to find the height of a hill . he/she takes a sight on the top of the hill and find that the angle of eleva
    12·1 answer
  • What is the heights part of Maine?
    5·1 answer
  • Historically, the introduction of technology has caused profound changes in the labor market and, temporarily at least, displace
    6·1 answer
  • Various factors to be considered in deciding the factor of safety?
    14·1 answer
  • Please help! timed test. This about electrical control. Please be serious.
    15·1 answer
  • Tech A says that coolant circulates through some intake manifolds to help warm them up. Tech B says that some intake manifolds u
    13·1 answer
  • What should one do with a load if one is going to leave a jack under a load?
    11·1 answer
  • How do guest room hotel smoke alarms work and differ then regular home versions?
    10·2 answers
  • Two children are playing on a seesaw. The child on the left weighs 50 lbs. And the child on the right weighs 100 lbs. If the chi
    5·1 answer
  • Whats the purpose of the keyway
    13·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!