VB编计算器 程序填空

Private Sub Calculate() ' 加减乘除运算
Select Case Op
Case 0
X = Val(X) + Val(Y)
______
___________________
______
___________________
______
___________________
End Select
Y = ""
Label2 = X
End Sub

Private Sub Digit_Click(Index As Integer) ' 数字按钮处理
Dim D$
If Finish Then X = "": Finish = False
_________________________________________ ' 将Index置换成数字和小数点
If Not Operater_Pressed Then
X = X & D
Label2 = X
Else
_________
__________
End If
End Sub

Private Sub Operator_Click(Index As Integer) ' 运算符按钮处理
____________ ' 执行加减乘除运算
Operater_Pressed = True
Op = Index
Finish = False
End Sub

Private Sub Deleter_Click(Index As Integer) ' 清除键、等号按钮处理
Select Case Index
Case 0 '→退格
If Not Operater_Pressed Then
If Len(X) > 0 Then X = Left(X, Len(X) - 1)
If X = "" Then Label2 = 0 Else Label2 = X
Else
__________________________________________
_________________________________________
End If
Case 1 'CE
If Not Operater_Pressed Then X = "" Else Y = ""
Label2 = 0
Case 2 'AC
X = "": Y = "": Label2 = 0
Operater_Pressed = False: Op = 0
Case 3 '=
Calculate
Operater_Pressed = False
Op = 0
Finish = True
End Select
End Sub
Private Sub Calculate() ' 加减乘除运算
Select Case Op
Case 0
X = Val(X) + Val(Y)
Case 1
X = Val(X)- Val(Y)
Case 2
X = Val(X)*Val(Y)
Case 3
X = Val(X)/ Val(Y)
End Select
Y = ""
Label2 = X
End Sub

Private Sub Digit_Click(Index As Integer) ' 数字按钮处理
Dim D$
If Finish Then X = "": Finish = False
if index>=0 and index<=9 then d=str(index) else d=".' ' 将Index置换成数字和小数点
If Not Operater_Pressed Then
X = X & D
Label2 = X
Else
Y =Y & D
Label2 = Y
End If
End Sub

Private Sub Operator_Click(Index As Integer) '段握 运算符按钮处理
if Operater_Pressed then Calculate ' 执行加宽逗减乘除运算
Operater_Pressed = True
Op = Index
Finish = False
End Sub

Private Sub Deleter_Click(Index As Integer) ' 清除键、等号按钮处理
Select Case Index
Case 0 '→退格
If Not Operater_Pressed Then
If Len(X) > 0 Then X = Left(X, Len(X) - 1)
If X = "" Then Label2 = 0 Else Label2 = X
Else
If Len(Y) > 0 Then Y = Left(Y, Len(Y) - 1)
If Y = "" Then Label2 = 0 Else Label2 = Y
End If
Case 1 'CE
If Not Operater_Pressed Then X = "慎燃卖" Else Y = ""
Label2 = 0
Case 2 'AC
X = "": Y = "": Label2 = 0
Operater_Pressed = False: Op = 0
Case 3 '=
Calculate
Operater_Pressed = False
Op = 0
Finish = True
End Select
End Sub