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
A data structure used to bind an authenticated individual to a public key is the definition of ________.
patriot [66]

Answer:

Digital Certificate is the correct answer of this question.

Explanation:

Digital certificates are always for encryption and identification for transmitting public keys.The concept of digital certificate is a data structure used for linking an authenticated person to a public key. It is used to cryptographically attach public key rights to the organization that controls it.

<u>For example</u>:- Verisign, Entrust, etc.

  • An appendix to an electronic document that is used for authentication purposes.
  • A digital certificate's most frequent use is to confirm that an user sending a message is who he or she appears to be, and provide the recipient with the means to encode a response.

4 0
2 years ago
Write steps: To open an old documents​
myrzilka [38]

Answer:

1.Click.

2.Choose “All Programs”

3.Then select, the “Microsoft Office” folder.

4.Now, open your desired Office application. 5.for e.g Microsoft Word 2010.

6.Once the application opens, select.

Click.

7.Now, select the document you wish to open in Office 2010 and click.

3 0
2 years ago
Write the SQL statements that define the relational schema (tables)for this database. Assume that person_id, play_id, birth_year
Sunny_sXe [5.5K]

Answer:

  • SQL statement that defines table for Actor

CREATE TABLE Actor(

person_id integer primary key,

name varchar2(40) not null,

birth_year integer check ((birth_year) <= 2019)

);

  • SQL statement that defines table for Play

CREATE TABLE Play(

play_id integer primary key,

title varchar2(60) not null,

author varchar2(60) not null,

year_written integer check ((year_written) <= 2019)

);

  • SQL statement that defines table for Role

CREATE TABLE Role (

person_id integer,

character_name varchar2(60) not null,

play_id integer,

constraint fk_person foreign key (person_id) references actor(person_id),

constraint fk_play foreign key (play_id) references play(play_id),

primary key (person_id, character_name, play_id)

);

Explanation:

Other information that were not added to the question are as below:

The following database contains information about three tables i.e. actors, plays, and roles they performed.

Actor (person_id, name, birth_year)

Play (play_id, title, author, year_written)

Role (person_id, character_name, play_id)

Where: Actor is a table of actors, their names, and the year they were born. Each actor has a unique person_id, which is a key.

Play is a table of plays, giving the title, author, and year written for each play. Each play has a unique play_id, which is a key.

Role records which actors have performed which roles (characters) in which plays.

Attributes person_id and play_id are foreign keys to Actor and Play respectively.

All three attributes make up the key since it is possible for a single actor to play more than one character in the same play

Further Explanation:

In SQL, in order to define relational schema (Tables) for a database, we use CREATE TABLE statement to create a new table in a database.  The column parameters specify the names of the columns of the table.  The datatype parameter specifies the type of data the column can hold (varchar, integer, date)

4 0
3 years ago
Why do we install doorbells in our house
Vinil7 [7]

Explanation:

It's placed near the door. When a visitor presses the button, the bell rings inside alerting you that someone is at the door.

6 0
2 years ago
Read 2 more answers
Jack was drinking a glass of water near his computer when his dog bumped his arm, spilling water on his keyboard. What is the fi
Anvisha [2.4K]

Answer:

4no. is the answer may be

3 0
2 years ago
Read 2 more answers
Other questions:
  • 20 points/ When creating a storyboard, in which section do you mention how you move from one shot to the next?
    11·1 answer
  • What is the name of the feature that can be enabled on slower-speed WAN links to prevent a large data transfer from affecting th
    10·1 answer
  • Complete the paragraph describing characteristics of an audio mixer
    8·2 answers
  • The fossil record is usually incomplete due to the destruction of fossils.
    10·1 answer
  • Which domain refers to the equipment and data an organization uses to support its IT infrastructure. It includes hardware, opera
    15·1 answer
  • The best place to start when you are looking for information about a device or an application is the ____ of the company that ma
    14·1 answer
  • Limitations of the information systems used by tesco​
    7·1 answer
  • Tara is creating a presentation for her science project about volcanoes. She added different animations to every slide for empha
    12·1 answer
  • How to create drop down list in excel with multiple selections.
    13·2 answers
  • 11. Explain different types of program control with suitable flow chart.<br> N
    15·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!