Hello, so I decided to start doing some C programming again to help refresh my memory. I decided to work on an amortization table for a loan. I found an example online of writing a program for calculating the interest rate for someone who buys a TV for 1000$ at an 18% interest rate with no down payment and a monthly payment of like 50$. I don't want to hard code the numbers.The program starts by asking the user for four numbers: The selling price, down payment, annual interest rate and the payment size.The program then displays a table like this that I have wrote up (with all payments displayed):
Pay # Old Balance Payment Interest To Balance New Balance
----- ---------------- ------------ ---------- -------------- ------------------
1 1000.00 50.00 15.00 35.00 965.00
2 965.00 50.00 14.48 35.52 929.48
…
…
23 95.69 50.00 1.44 48.56 47.13
24 47.13 47.84 0.71 47.13 0.00
-----------------------------------------------------------------------------------------
Total of payments = 1197.84
Total of interest = 197.84
Total to balance = 1000.00
I have an old program I wrote up a few years back that's actually very similar but it's slightly different, asking the user to enter in the term of the loan and now I don't need them to do that. Though I can't recall that program working correctly. Can I use my old program that I have but change some things around, like the loop and variables, to get it to do what I want now? I'll post the program I have in a pastebin link. Any help would be great.
http://pastebin.com/kam7sQE5