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
Which option is not a tab type?
BlackZzzverrR [31]

Answer:

its right i think

Explanation:

7 0
3 years ago
Which of these are part of the CPU?<br> O peripheral<br> O HDMI cord<br> O core<br> O keyboard
Makovka662 [10]
Hiii I think the best option would be C. Core
7 0
3 years ago
Rint "Censored" if userInput contains the word "darn", else print userInput. End with newline.
Marta_Voda [28]

If you're coding with C++ then the solution would be:

  if (userInput.find("darn") != -1) {

     cout << "Censored" << endl;

  }

  else{

     cout << userInput << endl;

  }

Keep in mind that this will reject any input with the word "darn" in the sentence. This will not filter the word darn if the capitalization is in different formats like "Darn, dArn, daRn, darN, DARN".

7 0
3 years ago
[Please Help ASAP!]
iragen [17]
The answer has to be C
3 0
3 years ago
Jean-Ann works in the finance business. She analyzes insurance applications in order to determine the level of risk involved in
Tamiku [17]

Answer:

She works as a insurance or tech applicator

Explanation:

5 0
3 years ago
Other questions:
  • Identify the correct XHTML syntax for inserting an image as a hyperlink from the options provided. A. book.gif B. C. D.
    9·1 answer
  • Upgrading only the motherboard will give some performance improvement to a computer system. Why would the improvement be limited
    14·1 answer
  • Kyra needs help planning what images and text to use in her web page what technique can help her
    5·2 answers
  • Which tab in Microsoft Word provides access to the backstage view?
    8·2 answers
  • HELP LOTS OF POINTS
    13·2 answers
  • Illustrate that the system is in a safe state by demonstrating an order in which the threads may complete.If a request from thre
    7·1 answer
  • Which of the following statements accurately describes linked data?
    5·1 answer
  • Give me at least five main characteristic of irrigation equipment​
    8·1 answer
  • The memory used by the CPU to temporarily hold data while processing is called _______. random access memory central processing
    5·1 answer
  • You are creating a web page as part of a science project. Your role is to put your data on the webpage. You tracked the growth o
    12·2 answers
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!