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
It is proposed to deposit a 5 μm thick nickel coating uniformly on all surfaces of a ceramic strip measuring 15 cm x 5 cm x 2 cm
MatroZZZ [7]

Answer:

Check the explanation

Explanation:

Let’s take for instance, when an object with a mass of 10 kg (m = 10 kg) is moving at a 5 meters per second (v = 5 m/s) velocity rate, the kinetic energy is equal to 125 Joules

Kindly check the attached images below to get the step by step explanation to the question above.

8 0
3 years ago
How has dissection used in engineering?
NeTakaya

Answer:

Product dissection has been widely deployed in engineering education as a means to aid in student's understanding of functional product elements, development of new concept ideas, and their preparation for industry.

Explanation:

I hope this helps :) have a wonderful day!

6 0
3 years ago
Read 2 more answers
Find an expectation value in the n th state of the harmonic oscillator.Find an expectation value in the n th state of the harmon
s344n2d4d5 [400]

The classical motion for an oscillator that starts from rest at location x₀ is

                                           x(t) = x₀ cos(ωt)

The probability that the particle is at a particular x at a particular time t

is given by ρ(x, t) = δ(x − x(t)), and we can perform the temporal average

to get the spatial density. Our natural time scale for the averaging is a half

cycle, take t = 0 → π/ ω

Thus,

ρ =   \frac{1}{\pi / w} \int\limits^\pi_0 {d(x - x_o cos(wt))} \, dt

Limit is 0 to π/ω

We perform the change of variables to allow access to the δ, let y = x₀ cos(ωt)  so that

ρ(x) = -\frac{w}{\pi } \int\limits^x_x {\frac{d ( x - y)}{x_ow sin(wt)} } \, dy

Limit is x₀ to -x₀

\frac{1}{\pi } \int\limits^x_x {\frac{d (x-y)}{x_o\sqrt{1 - cos^2(wt)} } } \, dy

Limit is -x₀ to x₀

= \frac{1}{\pi } \int\limits^x_x {\frac{d(x-y)}{\sqrt{x_o^2 - y^2} } } \, dy\\ \\= \frac{1}{\pi\sqrt{x_o^2 - x^2}  }

This has \int\limits^x_x {p(x)} \, dx  = 1 as expected. Here the limit is -x₀ to x₀

The expectation value is 0 when the ρ(x) is symmetric, x ρ(x) is asymmetric and the limits of integration are asymmetric.

6 0
4 years ago
Bài 3: Cho cơ cấu culít (hình 3.5) với các kích thước động lAB = 0,5lAC = 0,1m. Khâu 3 chịu tác dụng của mô men M3 = 500 N. Cơ c
lesya [120]
??????????????????????
3 0
3 years ago
People learn best in different ways. By combining all the group presentations, your class will explain how they see the optical
DENIUS [597]

Answer:

People learn best in different ways. By combining all the group presentations, your class will explain how they see the optical illusion in a way that every student will be able to understand. Which presentation helped you understand how you saw the optical illusion best?

I cont under stand

4 0
3 years ago
Read 2 more answers
Other questions:
  • Identify the reattachment point.
    8·1 answer
  • A horizontal curve is to be designed for a two-lane road in mountainous terrain. The following data are known: Intersection angl
    7·1 answer
  • Heat in the amount of 100 KJ is transferred directly from a hot reservoir at 1200 K to a cold reservoir at 600K.Calculate the en
    12·2 answers
  • Physical items produced in an economy are known as
    15·1 answer
  • The heat transfer rate due to free convection from a vertical surface, 1 m high and 0.6 m wide, to quiescent air that is 20 K co
    12·1 answer
  • Which of the following actions by farmers contributes to desertification?
    6·1 answer
  • If a vehicle is built with a top speed of 140 mph, what should its tires minimum speed
    5·1 answer
  • Which is one of the aspects in PR game marketing?
    6·2 answers
  • Okay<br>going offline bye<br>have a great day​
    10·2 answers
  • Why are manhole covers round in most of the cases?
    7·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!