Question: - In C ++ Console - When you borrow money to buy a house, a car, or for some other purpose, you repay the loan

- In C ++ Console -

When you borrow money to buy a house, a car, or for some other purpose, you repay the loan by making periodic payments over a certain period of time. Of course, the lending company will charge interest on the loan. Every periodic payment consists of the interest on the loan and the payment toward the principal amount.

To be specific, suppose that you borrow $1000 at the interest rate of 7.2% per year and the payments are monthly. Suppose that your monthly payment is $25. Now, the interest is 7.2% per year and the payments are monthly, so the interest rate per month is 7.2/12 = 0.6%. The first months interest on $1000 is 1000 * 0.006 = 6. Because the payment is $25 and interest for the first month is $6, the payment toward the principal amount is 25 6 = 19. This means after making the first payment, the loan amount is 1000 19 = 981. For the second payment, the interest is calculated on $981. So the interest for the second month is 981 * 0.006 = 5.886, that is, approximately $5.89. This implies that the payment toward the principal is 25 5.89 = 19.11 and the remaining balance after the second payment is 981 19.11 = 961.89. This process is repeated until the loan is paid.

Write a program that accepts as input the loan amount and the interest rate per year. (Enter the interest rate as a percentage. For example, if the interest rate is 7.2% per year, then enter 7.2.)

The program should then calculate the minimum monthly payment and let the user know that in order to eventually pay the loan off, they have to pay at least the minimum amount due. Then ask the user for the amount they wish to pay on the loan each month. (Note that if the monthly payment is less than the first months interest, then after each payment, the loan amount will increase. In this case, the program must warn the borrower that the monthly payment is too low, and with this monthly payment, the loan amount could not be repaid.)

Then calculate and print out a list of all the payments. Include in this list the month number, interest payment, principal payment, current balance. Your last payment might be more than the remaining loan amount and interest on it. In this case, output the loan amount before the last payment and the actual amount of the last payment. (Note that the month number does not represent what month it is, but what number payment it is. For example, a three year loan would have months number from 1 - 36).

Also, output the total interest paid.

More descriptive details -

1)Get the interest rate and the loan amount from the user. 2)Calculate the monthly interest by multiplying the loan amount by the rate/100/12... this will get the percentage entered into an actual percent...(7.2 will become .072/12 becomes .006) 3)Get the monthly payment amount from the user 4)Do a loop to make sure the payment entered is more than the interest (minimum monthly payment) 5)Then you can do another loop that will continue until the loan is paid.

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!