Private Sub Command1_ Click()
Dims As String, c As String, i As Integer
Dim sum As Single, sum1 As Single, sum2 As Single, k As Integer,j As Integer
s = Text1.Text : sum2=0:k= 1
For i= 1 To Len(s)
c=
If c= "*" Or c= "/" Then
If c="*" Then
sum = Val(Mid(s,i+ 1, 1)) * Val(Mid(s,i- I, 1))
Else
sum = Val(Mid(s, i- 1, 1))/ Val(Mid(s,i+ 1,1))
End If
j=i-2
Do While
c = Mid(s,j, 1)
If c="+" Then sum1 = Val(Mid(s,j-1, 1)) + sum
If c="-" Then sum1 = Val(Mid(s,j- 1, 1)) - sum
sum=sum1
j=j- 1
Loop
If k=1 Then
sum2 = sum2 + sum
Else
c= Mid(s, k, 1)
If c =“+" Then sum2 = sum2 + sum
If c="" Then sum2 = sum2 - sum
End If
k=
End If
sum=0
Next i
Label2.Caption = sum2
End Sub