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
Anna71 [15]
3 years ago
15

Please write a complete program to calculate monthly payment given

Computers and Technology
1 answer:
jasenka [17]3 years ago
7 0

Explanation:

Code with comments:

#include <stdio.h>

#include <math.h>  

/* math library is required to use pow() function

First we need to create a function to calculate the Monthly Payment

It would take three inputs Rate, Years, and Principle amount

Then we converted the Rate and Months according to problem statement

pow() function is used to find (1+R)^M

Then finaly this function returns the value of Monthly Payment  */

float MonthlyPay(float R, int M, int P)

{

    R=R/1200;

    M=M*12;

   float po=pow((1+R),M);

   float PayM=(R+(R/(po-1)))*P;

    return PayM;

}

/*  In the main() function we get 3 inputs from the user Years, Rate and Principle amount

then we call the MonthlyPay function and pass it 3 inputs that we got from the user

then we calculated the total Payment by multiplying the Monthly Pay and total number of months

then we calculated the interest Amount by subtracting the Principle Amount from total Pay

Testing is performed and output result is given at the end and also attached in the image   */

int main(void)

{

    float Rate;

    int Year, Amount;

    printf("Enter Years: ");

    scanf("%d",&Year);

    printf("Enter Rate: ");

    scanf("%f",&Rate);

    printf("Enter Principle Amount: ");

    scanf("%d",&Amount);

   

    float Pay = MonthlyPay(Rate, Year, Amount);

    printf ("Monthly Payment is: %f \n", Pay);

    float totalPay=Pay*Year*12;

    printf ("Total Payment is: %f \n", totalPay);

    float interest=totalPay-Amount;

    printf ("Interest Expense is: %f \n", interest);

    return 0;

}

Output:

Enter Years: 5

Enter Rate: 7

Enter Principle Amount: 12200

Monthly Payment is: 241.572767

Total Payment is: 14494.367188

Interest Expense is: 2294.367188

You might be interested in
How can the geographic location of data centers be beneficial for a company that is concerned about sustainability?
goldfiish [28.3K]
Answer : A- by placing data centers in remote areas so that their emissions are less of a concern. B- by allowing the use of renewable local resources such as solar or wind energy
6 0
3 years ago
Differentiate between time high and time low?
Y_Kistochka [10]
STAR PLATINUM ZA WARUDO... ORA ORA ORA ORA ORA ORA ORA ORA ORA
7 0
3 years ago
0.0% complete question a forensics analyst is attempting a live acquisition of the contents of the memory of a running linux dev
Sonja [21]

Based on the question, the  Recommendation of  a framework that will enable the analyst to install a kernel driver is said to be Volatility.

<h3>What is the Volatility framework?</h3>

Volatility is said to be a kind of an open source framework that is known to be used in times of memory forensics as well as digital investigations.

Note that The framework is one that tends to inspects and take out the memory artifacts that pertains to 32-bit and 64-bit systems. The framework has aided for all kinds of Linux, Windows, and others.

Hence, Based on the question, the  Recommendation of  a framework that will enable the analyst to install a kernel driver is said to be Volatility.

Learn more about Volatility from

brainly.com/question/27993482

#SPJ1

8 0
2 years ago
Write an algorithm of telephone call system​
ivolga24 [154]

Answer:

this is the correct answer

3 0
3 years ago
Read 2 more answers
The basic information in a database program is stored in a table format similar to a:
Ierofanga [76]

Can you add the options?

7 0
3 years ago
Other questions:
  • A prime number is a number that is only evenly divisble by itself and 1.
    12·1 answer
  • The domain in an email message tells you what?
    11·1 answer
  • When you use your fingerprint on a reader attached to your computer to authenticate yourself as the legitimate computer user, wh
    6·1 answer
  • Create a list of 15 colleges in Texas
    8·2 answers
  • Which of these network connections would allow your smartphone to sync your photos to your online account? Choose all that apply
    8·1 answer
  • In this lab you are asked to declare two variables of type integer: userNum and x. The user should input should be stored using
    8·1 answer
  • Question 1<br> REVPAR and REVPOR are basically the same thing.<br> True<br> False
    11·1 answer
  • Erik is the president and owner of Watch Out, a local website development company that helps clients create and build unique web
    15·1 answer
  • How do the interests of carriers differ from the interests of websites? What are the implications for websites from a value chai
    8·1 answer
  • A user informs you that he or she never deletes any files he or she creates. How might this affect the operating system? It will
    11·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!