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
"what is the problem with using challenge handshake authentication protocol (chap) as an authentication protocol?"
Alexxandr [17]

Its use of the message digest 5 (MD5) hash algorithm for security.

CHAP uses a combination of MD5 hashing and a challenge-response mechanism, and authenticates without sending passwords as plaintext over the network. The security of the MD5 hash function is severely compromised.

5 0
3 years ago
Which technology concept uses computer resources from multiple locations to solve a common problem?
kramer

Answer: Sounds like you are talking about “Distributed memory systems” which use multiple computers to solve a common problem, with computation distributed among the connected computers (nodes) and using message-passing to communicate between the nodes.

8 0
3 years ago
Question # 5
Mazyrski [523]

for num in range(4):

   print(num)

The output will be:

0

1

2

3

The for loop iterates through the numbers in the range function and prints those same numbers to the console.

6 0
2 years ago
Read 2 more answers
Please help, I can't find the answer but I understand the topic.
gladu [14]

Answer:

x=(2+3)*3;

Explanation:

3 0
3 years ago
Read 2 more answers
What are the external parts of a computer system and which are output devices and which are input devices
cestrela7 [59]
I'd question the wording, However:

Monitor, Output device.
Keyboard, Input device.
Mouse, Input device.
Speakers Output Device.
Microphone, Input device.
Printer, Output device.
Scanner, input device.

Devices do not have to explicitly be one or the other e.g. a printer with a scanner, or headphones with a microphone.  
4 0
3 years ago
Other questions:
  • 2. Consider the two-dimensional array A: int A[][] = new int[100][100]; where A[0][0] is at location 200 in a paged memory syste
    11·1 answer
  • Cell height can be changed by. Select all that apply
    15·2 answers
  • A characteristic of a 3D model that a 2D model does not have is:
    8·1 answer
  • ___ involves connecting geographically remote computers into a single network and combining the computational power of all compu
    14·1 answer
  • You want to deploy a software package that's available to all users in the domain if they want to use it, but you don't want the
    7·1 answer
  • Suppose that a server sends four packets of audio data, in 15 seconds each. The first is sent by the server exactly at noon (12:
    14·1 answer
  • In Access, it is possible to have _______________ fields, that is, fields that can contain more than one value.
    9·1 answer
  • Anyone down to play gta later i play on ps4?
    15·2 answers
  • What is bespoke software???​
    9·2 answers
  • Explain how the organ systems work together to warm up the body on a cold day
    12·2 answers
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!