I am having a lot of trouble getting my loan calculator to loop. My program is meant to prompt a user for some info, do some calculations, and create an amortization table telling the user how much they will have to pay each month in order to pay off their loan in the allotted time. My issue is that the program goes through successfully once, but just repeats itself with all the same info. More specifically, if the initial balance of the loan is 5000.00, and the new balance after a payment is 4500.00, instead of my program having a starting balance of 4500.00 the next month, it just starts at 5000.00 again. Can I get any help with this? Here is my code:
For one, the variables were never changed inside your loop, plus you have a loop that is set at 48, not how many months the user enters. Here is your program with the variables moved to inside the loop and the loop to user inputted months. You still have a problem with your loan payment amounts, etc. When a loan is paid in installments, it should be paid off at the end of the period. That formula is something you'll have to find out.