Please help me. I have to make a program that prints out the payment plan for a house. The program should look like this but not necessarily with those numbers:
What is the value left on the mortgage?
10000
What is the annual interest rate of the loan, in percent?
12
What is the monthly payment?
500
Month Payment Amount Owed
1 500.00 9600.00
2 500.00 9196.00
3 500.00 8787.96
...
22 500.00 211.37
23 213.48 0
Calculation explanation: If the annual interest rate is 12%, the monthly rate is 1%. Thus, the interested accrued in the first month is $10000 x .01 = $100 and the loan value is $10,100 right before payment. After the payment, the amount owed is $10100 - $500 = $9600. After the second month, the value owed is $9600 + $9600 x .01 = $9696. After making the payment, $9196.00 is owed. In month 22, $711.37 is owed. After the $500 payment, $211.37 is owed. BUT, after the end of month 23, $213.48 is owed due to the interest on the $211.37 for one month, which is about $2.11. Thus, the last payment has to be $213.48 and not $211.37.
I also must calculate if the monthly payment will pay off the mortgage! If the payment is too low, I have to let the user know right away.
Ex:
What is the value left on the mortgage?
10000
What is the annual interest rate of the loan, in percent?
12
What is the monthly payment?
100
Sorry, this plan won’t work.
Please help me. I know that the only thing I need is an if-else statement and a while loop in the else statement but I am lost as to how to make the loop work properly. I am only allowed to use <stdio.h> and <stdlib.h>. Here is what I have so far: