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
Chief technology officers typically earn more working for private companies than for schools or universities.
jonny [76]
The answer is true but it depends
5 0
4 years ago
Read 2 more answers
Click to review the online content. Then answer the question(s) below, using complete sentences. Scroll down to view additional
kumpel [21]

Explanation:

hope this help here is the answer

3 0
3 years ago
I need to know the answer to this question
RoseWind [281]

It's D because all of this are TRUE.

3 0
3 years ago
python Write a class named Taxicab that has three **private** data members: one that holds the current x-coordinate, one that ho
Blizzard [7]

Answer:

see explaination

Explanation:

class Taxicab():

def __init__(self, x, y):

self.x_coordinate = x

self.y_coordinate = y

self.odometer = 0

def get_x_coord(self):

return self.x_coordinate

def get_y_coord(self):

return self.y_coordinate

def get_odometer(self):

return self.odometer

def move_x(self, distance):

self.x_coordinate += distance

# add the absolute distance to odometer

self.odometer += abs(distance)

def move_y(self, distance):

self.y_coordinate += distance

# add the absolute distance to odometer

self.odometer += abs(distance)

cab = Taxicab(5,-8)

cab.move_x(3)

cab.move_y(-4)

cab.move_x(-1)

print(cab.odometer) # will print 8 3+4+1 = 8

5 0
4 years ago
Jacob develops a new app that will display the current weather centered on a user's location and notify the user in the case of
____ [38]

Answer:

C GIVE ME BRAINLEST

Explanation:

5 0
3 years ago
Read 2 more answers
Other questions:
  • Which pane displays commands that change relative to the activity taking place in the presentation window's main work area?
    11·2 answers
  • Most sim cards allow ___________ access attempts before locking you out.
    10·1 answer
  • How to use command prompt​
    14·1 answer
  • Identify the effective editing strategy.
    8·2 answers
  • Can someone answer this ?
    7·1 answer
  • write a java program that prompts the user to enter scores (each number an integer from 0 to 10) and prints the following output
    13·1 answer
  • How do open online courses help with independent learning
    6·2 answers
  • What are your thoughts about this re-designed Logo? Is it good? Or is poorly designed? Explain your answer below.
    13·1 answer
  • Malware is any malicious software installed on a computer or network without the owner’s knowledge.
    10·1 answer
  • What is the best response to cyberbullying?
    10·2 answers
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!