这是一个贷款计算器程序。我在数学上有问题。除了 2 个月后的期初余额值外,其他一切似乎都是正确的。请注意,第 3 个月的期初余额与第 2 个月的期末余额不同。接下来的几个月也是如此。我一直在尝试修复它,但一切都没有解决。我需要它们相同,所以上个月的期末余额将为 0。
这是程序的示例输出:
Personal Loan Payment Calculator
Enter a loan amount: 1000
Enter the loan term (months): 6
Enter the interest rate (% per year): 9
Loan Payment and Amortization Table
Months Beginning Monthly Principal Interest Ending
Balance Payment Paid Paid Balance
1 1000.00 171.07 163.57 7.50 836.43
2 836.43 171.07 164.80 6.27 671.64
3 670.41 171.07 166.04 5.03 504.37
4 501.88 171.07 167.30 3.76 334.57
5 330.78 171.07 168.59 2.48 162.19
6 157.06 171.07 169.89 1.18 -12.83
Summary:
========
Loan Amount: $1,000.00
Monthly Payment: $171.07
Number of Payments: 6
Total Interest Paid: $24.00
Annual Interest Rate: 9.00%
慕沐林林
相关分类