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
A rigid tank whose volume is 2 m3, initially containing air at 1 bar, 295 K, is connected by a valve to a large vessel holding a
bazaltina [42]

Answer:

Q_{cv}=-339.347kJ

Explanation:

First we calculate the mass of the aire inside the rigid tank in the initial and end moments.

P_iV_i=m_iRT_i (i could be 1 for initial and 2 for the end)

State1

1bar*|\frac{100kPa}{1}|*2=m_1*0.287*295

m_1=232kg

State2

8bar*|\frac{100kPa}{1bar}|*2=m_2*0.287*350

m_2=11.946

So, the total mass of the aire entered is

m_v=m_2-m_1\\m_v=11.946-2.362\\m_v=9.584kg

At this point we need to obtain the properties through the tables, so

For Specific Internal energy,

u_1=210.49kJ/kg

For Specific enthalpy

h_1=295.17kJ/kg

For the second state the Specific internal Energy (6bar, 350K)

u_2=250.02kJ/kg

At the end we make a Energy balance, so

U_{cv}(t)-U_{cv}(t)=Q_{cv}-W{cv}+\sum_i m_ih_i - \sum_e m_eh_e

No work done there is here, so clearing the equation for Q

Q_{cv} = m_2u_2-m_1u_1-h_1(m_v)

Q_{cv} = (11.946*250.02)-(2.362*210.49)-(295.17*9.584)

Q_{cv}=-339.347kJ

The sign indicates that the tank transferred heat<em> to</em> the surroundings.

8 0
3 years ago
What type of foundation do engineers use for a small and light building and when the load of the building is borne by columns? A
ikadub [295]

Answer:

A.

Explanation:

Individual footings are the commonest, and they are often used if the load of the building is borne by columns. Typically, every column will have an own footing. The footing is usually only a rectangular or square pad of concrete on which the column is erected

8 0
3 years ago
An example of the split-off point in oil, gasoline, and kerosene production is that point where crude oil is
eimsori [14]

i believe the correct answer is c but i’m sorry if i’m not correct

8 0
3 years ago
What careers could you potential do if you
Margarita [4]

Answer:

Engineering careers. If you want to stay in engineering, your job opportunities are very much linked to your degree type, and you probably know what many of them are already. ...

Consulting. ...

Technical writing. ...

Business. ...

Investment banking. ...

Law. ...

Manufacturing and production. ...

Logistics and supply chain.

Explanation:

3 0
3 years ago
PELASEE HELPPP WITH MARK BRAINLIST!!!! You are stopped at a red light, and a long string of cars is crossing in front of you. Wh
choli [55]

Answer:

1st one.

Explanation:

I think that because they the one who is going to get a ticket and also you will not gonna get in a car accident.

7 0
3 years ago
Read 2 more answers
Other questions:
  • Amanda and Tyler opened a business that specializes in shipping liquids, such as milk, juice, and water, in cylindrical containe
    5·1 answer
  • Please choose a specific type of stability or control surface (e.g., a canard) and explain how it is used, what it is used for,
    5·1 answer
  • Giving out 100 coins cuz why not?​
    11·1 answer
  • I need help due today please help
    5·1 answer
  • What is one of the most common ways in which workers get hurt around machines?
    14·1 answer
  • Workers who work with what kind of chemicals chemicals may require regular medical checkups on a more frequent basis as a result
    15·1 answer
  • REVVIVE ME MY MOM WALKED IN MY ROOM AND SCARED THE BAJESUS OUTTA ME
    5·2 answers
  • Why do giant stars become planetary nebulas while supergiant stars become supernovas when their nuclear fusion slows and is over
    8·1 answer
  • Flip-flops are normally used for all of the following applications, except ________. logic gates data storage frequency division
    6·1 answer
  • with a digital system, if you have measured incorrectly and use too low of a kvp for adequate penetration, what do you need to d
    9·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!