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
Size of a request header field exceeds server limit.
garri49 [273]
Try to Increase the value for the directive LimitRequestFieldSize in the httpd.conf:


Reason: This is normally caused by having a very large Cookie, so a request header field exceeded the limit set for Web Server.
For IBM® HTTP Server, this limit is set by LimitRequestFieldSize directive (default 8K). The LimitRequestFieldSize directive allows the Web server administrator to reduce or increase the limit on the allowed size of an HTTP request header field.
SPNEGO authentication headers can be up to 12392 bytes. This directive gives the server administrator greater control over abnormal client request behavior, which may be useful for avoiding some forms of denial-of-service attacks.

8 0
3 years ago
Why does brainly keep saying “oops... something went wrong! Try again”
ss7ja [257]
Idek this keeps happening to me too :/
6 0
3 years ago
Read 2 more answers
Repl.it Assignment 4.1.3 (Max and Min)<br> Please help me<br> I will give brainliest and a like
earnstyle [38]
-31 or 21- 50 it may also carry -31
3 0
4 years ago
Overnight Delivery Service delivers a package to Pam. At the request of Overnight's delivery person, to acknowledge receipt Pam
SSSSS [86.1K]

Answer:

Option b (a digitized handwritten signature) would be the right option.

Explanation:

  • Another photograph of such a handwritten signature was used to digitally sign transcripts that would be perceived to have become a "digitized signature."
  • Those same kinds of signature verification may take a glance official, but they don't protect against widespread fraud, a vital component of every other internet signature.

The latter available options weren’t connected to the type of situation in question. So the response above would be the correct one.

3 0
3 years ago
What are the two contextual tabs that appear when working with PivotTables?
Nutka1998 [239]

Answer:

<u>D.Analyze and Design</u>

8 0
3 years ago
Read 2 more answers
Other questions:
  • Design a kernel module that iterates through all task in the system using the for_each_process() macro. In particular, output th
    7·1 answer
  • Which osi layer is responsible for directing data from one lan to another?
    13·1 answer
  • The part of the poppet valve that contacts the valve seat is called the A. face. B. margin. C. head. D. stem.
    6·2 answers
  • Write a function called line_numberthat takes as parameters two strings representing file names. Assume these are text files. Th
    15·1 answer
  • Which product is made using bacteria?<br>O A. Maple syrup<br>O B. Cork<br>O C. Latex<br>D. Yogurt​
    12·1 answer
  • Hooollaaaa , todos absolutamente todos quieren borrar esta tarea por que no tiene nada que ver con la materias del colegiooo per
    7·2 answers
  • Which statement best describes an advantage of using the Subtotal dialog box?
    14·1 answer
  • 01 Describe all the possible component of a chart​
    8·1 answer
  • Write code which takes two inputs from the user, a number of sides followed by a side length, then creates a regular polygon wit
    10·2 answers
  • HELP NEEDED PLEASE HELP!!! ​
    11·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!