我正在使用Vb.net创建贷款摊还表。一切正常但我的循环无法正常工作。它应该显示所有减少的每月付款,一个接一个地平衡。我的循环代码如下:
Listbox1.Items.Add("Nos" & vbTab & "Periodic" & vbTab & "Payment" & vbTab & "Payment" & vbTab & "Balance")
Listbox1.Items.Add("" & vbTab & "Payment" & vbTab & "Interest" & vbTab & "Principal" & vbTab & "")
Listbox1.Items.Add("__________________________________________________________________________________________")
Dim a As Integer
**For a = 1 To n
monthly_Interest = (p * (txtbox_Rate.Text / 100) * (1 / 12))
monthlyPrincipal = monthlyPayments - monthlyInterest
balance = p - monthlyPrincipal
Listbox1.Items.Add(a & vbTab & FormatCurrency(monthlyPayments, 2) & vbTab & FormatCurrency(monthly_Interest, 2) & vbTab & FormatCurrency(monthlyPrincipal, 2) & vbTab & FormatCurrency(balance, 2))
Next**