纳税金额

来源:互联网 发布:乌鲁木齐网络赛 编辑:程序博客网 时间:2024/04/27 21:11

Private Sub Command1_Click()
Dim a, x As Single
a = Val(Text1.Text)
If a <= 800 Then
x = 0
Else
a = a - 800
If a <= 500 Then
x = a * 0.05
Else
x = 500 * 0.05
a = a - 500
If a <= 1500 Then
x = x + a * 0.1
Else
x = x + 1500 * 0.1
a = a - 1500
If a <= 3000 Then
x = x + a * 0.15
Else
x = x + 3000 * 0.15
a = a - 3000
If a <= 15000 Then
x = x + a * 0.2
Else
x = x + 15000 * 0.2
a = a - 15000
If a <= 20000 Then
x = x + a * 0.25
Else
x = x + 20000 * 0.25
a = a - 20000
If a <= 20000 Then
x = x + a * 0.3
Else
x = x + 20000 * 0.3
a = a - 20000
If a <= 20000 Then
x = x + a * 0.35
Else

x = x + 20000 * 0.35
a = a - 20000
If a <= 20000 Then
x = x + a * 0.4
Else
a = a - 100000
x = x + a * 0.45 + 100000 * 0.45
End If
End If
End If
End If
End If
End If
End If
End If
End If

Text2.Text = Str(x)
End Sub

Private Sub Command2_Click()
Text1.SetFocus
Text1.Text = ""
Text2.Text = ""

End Sub