我有一个投资回报应用程序,该应用程序将收取投资金额并每年产生总额的 5% 的回报,并以ListBox
. 我没有收到任何错误,但 GUI 没有在列表框中显示投资收益。任何建议,将不胜感激。这是我到目前为止的代码:
Public Class Form1
Const Interest_Rate As Double = 0.05
Private Sub btncmdCalculate_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btncmdCalculate.Click
Dim num_years As Integer
Dim intCounter As Integer
Dim current_value As Double
Dim future_amount As Double
current_value = Val(txtcurrent_value.Text)
num_years = Val(txtnum_years.Text)
current_value = current_value * Interest_Rate * num_years & vbTab _
'calculate amount
For intCounter = 1 To num_years
future_amount = current_value * (1 + Interest_Rate) ^ intCounter
lstBalances.Text = current_value * Math.Pow(1 + Interest_Rate, intCounter) & "" & _ vbTab & FormatCurrency(current_value)"
Next intCounter
End Sub