代码:
Private Sub Command1_Click()
Dim n As Single, w As Single
Dim s As Single, m As Single
n = Val(Text1.Text)
w = n - 500
Select Case w
Case Is <= 500
s = 0.05
Case Iw < 2000
s = 0.1
Case Is <= 5000
s = 0.15
Case Is <= 20000
s = 0.2
Case Is <= 40000
s = 0.25
Case Is <= 60000
s = 0.3
Case Is <= 80000
s = 0.35
Case Is <= 100000
s = 0.4
Case Is > 100000
s = 0.45
End Select
m = w * s
Text2.Text = m
End Sub
Private Sub Command2_Click()
Text1.Text = ""
Text2.Text = ""
End Sub
心得体会:通过老师的讲解,明白了Select Case结构,并根据课本上的程序,自己慢慢的编出了合适的程序,感觉慢慢的懂得了一些编程技巧。