Public Class Form1
Private Sub Button1_Click(sender As Object, e As EventArgs) Handles Button1.Click
Dim num, sum, i As Integer
num = TextBox1.Text
If num > 0 Then
Select Case num
Case Is >= 100
sum = num * 500 * 0.8
Case Is >= 50
sum = num * 500 * 0.9
Case Is > 25
sum = num * 500 * 0.95
Case 1 To 25
sum = num * 500
End Select
Else
MsgBox("重新輸入數量", 32, "錯誤訊息")
Label5.Text = ""
End If
Label4.Text = sum & "元"
i = sum \ 2000
Select Case i
Case Is < 0
Label5.Text = ""
Case Is = 0
Label5.Text = "無"
Case Is < 5
Label5.Text = "抵用券" & i * 200 & "元"
Case Is >= 5
Label5.Text = "抵用券1000元"
End Select
End Sub
End Class
沒有留言:
張貼留言