Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Please write program in C++ please! When you borrow money to buy a house, a car, or for some other purpose, you repay the loan

Please write program in C++ please!image text in transcribed

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. Suppose you borrow $1,000 at an interest rate of 7.2% per year and the payments are monthly Suppose your monthly payment is $25. The interest rate is 7.2% per year and the payments are monthly, so the interest rate per month is 7.2 / 12 0.6%. The first month's interest on $1,000 is 1000 x 0.006 = 6 Because the payment is $25 and the 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. The interest for the second month is 981 x 0.006 = 5.886 which is approximately $5.89. This means 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 oan is paid. Write a program that accepts as input the loan amount, the interest rate per year, and the monthly payment. (Enter the interest rate as a percentage. For example, if the interest rate is 7.2% per year, then enter 7.2) The program then outputs the number of months it would take to repay the loan and total amount paid. (Note that if the monthly payment is less than the first month's interest, then after each payment, the loan amount would 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.)

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Advances In Databases And Information Systems 23rd European Conference Adbis 2019 Bled Slovenia September 8 11 2019 Proceedings Lncs 11695

Authors: Tatjana Welzer ,Johann Eder ,Vili Podgorelec ,Aida Kamisalic Latific

1st Edition

3030287297, 978-3030287290

More Books

Students also viewed these Databases questions

Question

Write minutes of meetings and summaries.

Answered: 1 week ago

Question

why are Canary releases used

Answered: 1 week ago