The world’s Largest Sharp Brain Virtual Experts Marketplace Just a click Away
Levels Tought:
Elementary,Middle School,High School,College,University,PHD
| Teaching Since: | May 2017 |
| Last Sign in: | 399 Weeks Ago |
| Questions Answered: | 66690 |
| Tutorials Posted: | 66688 |
MCS,PHD
Argosy University/ Phoniex University/
Nov-2005 - Oct-2011
Professor
Phoniex University
Oct-2001 - Nov-2016
Write a C++ program which will calculate the monthly balance of a debt. Each month a payment is made on the balance, and interest is added to the balance using a fixed percentage rate. You are to print a table showing how long it would take to pay it off and how much would be paid in total when the balance was paid off.
Begin your program by asking for the starting balance on the account, the annual percentage rate (APR) for interest, and the monthly payment made on the account. Then print out a table with one row for each month. Each row should list the month number, the payment made that month, the interest earned that month, and the new balance for that month.
For example, suppose you borrown $1000 at 8% making $100 monthly payments. The first month you would pay $100, bringing the balance down to $900. But you would then earn 0.67% interest on the $900, which is $6, bringing the total balance to $906.
Starting balance: 1000
Interest rate (APR): 8
Monthly payment: 100
Month Payment Interest Balance
----------------------------------------
1 100.00 6.00 906.00
2 100.00 5.37 811.37
3 100.00 4.74 716.12
4 100.00 4.11 620.22
5 100.00 3.47 523.69
6 100.00 2.82 426.52
7 100.00 2.18 328.69
8 100.00 1.52 230.22
9 100.00 0.87 131.09
10 100.00 0.21 31.29
11 31.29 0.00 0.00
Total amount paid: 1031.29
Some things to note:
* The APR is an annual percentage rate. To get the monthly percentage rate you must divide by 12.
* It's possible for the interest to be higher than the payment, in which case the balance for the account will go up rather than down. If this happens your program should simply print a line saying that the balance can never be paid off.
* All dollar ammounts should be printed with two digits after the decimal point.
* Column widths should be 8 for the month, 10 for payment and interest, and 12 for the balance.
* Use double precision floating point variables to store the floatin point values.
Hel-----------lo -----------Sir-----------/Ma-----------dam-----------Tha-----------nk -----------You----------- fo-----------r u-----------sin-----------g o-----------ur -----------web-----------sit-----------e a-----------nd -----------and----------- ac-----------qui-----------sit-----------ion----------- of----------- my----------- po-----------ste-----------d s-----------olu-----------tio-----------n.P-----------lea-----------se -----------pin-----------g m-----------e o-----------n c-----------hat----------- I -----------am -----------onl-----------ine----------- or----------- in-----------box----------- me----------- a -----------mes-----------sag-----------e I----------- wi-----------ll