[求助]机票计费
新手,实在搞不定了,请各位高手帮帮忙Dim fare, a, itemdata As Integer
Dim dis1, dis2, dis11, dis12, dis13 As Single
Private Sub Combo1_Change()
a = Combo1.itemIndex
End Sub
Private Sub Form_Load()
dis1 = 1: dis2 = 1: dis11 = 1: dis12 = 1: dis13 = 1
Combo1.AddItem "青岛-北京", 0
Combo1.AddItem "北京-青岛", 1
Combo1.AddItem "青岛-杭州", 2
Combo1.AddItem "杭州-青岛", 3
Combo1.AddItem "青岛-上海", 4
Combo1.AddItem "上海-青岛", 5
Combo1.itemdata(0) = 2000
Combo1.itemdata(1) = 1500
Combo1.itemdata(2) = 3000
Combo1.itemdata(3) = 3500
Combo1.itemdata(4) = 3600
Combo1.itemdata(5) = 4200
End Sub
Private Sub Option1_Click()
If Option1.Value = True Then
dis1 = 0.5
End If
End Sub
Private Sub Option2_Click()
If Option2.Value = True Then
dis1 = 0.7
End If
End Sub
Private Sub Option3_Click()
If Option3.Value = True Then
dis1 = 1
End If
End Sub
Private Sub Check1_Click()
If Check1.Value = 1 Then
dis11 = 0.6
End If
End Sub
Private Sub Check2_Click()
If Check2.Value = 1 Then
dis12 = 0.5
End If
End Sub
Private Sub Check3_Click()
If Check3.Value = 1 Then
dis13 = 0.7
End If
End Sub
Private Sub Command1_Click()
dis2 = dis2 * dis11 * dis12 * dis13
fare = Combo1.itemdata(a) * dis1 * dis2
Label8.Caption = fare
End Sub