储蓄是美德
今天我写一个软件,"储蓄是美德" 无法运行Private Sub cmdcompute_click()
Dim day_deposit As Double
Dim total_deposit As Double '当天存款为累积存款
Dim days As Integer '持续存款天数
day_deposit = Val(txtDeposit)
days = Val(txtdays)
total_deposit = day_deposit '第一天 的存款等于当天存款
For i = 2 To days
day_deposit = day_deposit * 2 '每天存款为前一天的二倍
total_deposit = total_deposit + day_deposit '累计总存款金额
Next i
Rem 显示结果
ibiday_deposit.Caption = Format(day_deposit, "#########,###")
ibitotal_deposit.Caption = Format(total_deposit, "#########,###")
End Sub
Private Sub cmdend_click()
End
End Sub
希望大家指点下