Solution.PublicClass frmMenu
Private Sub chkBurgers_CheckedChanged(ByVal sender As Object, ByVal e As EventArgs)
HandleschkBurgers.CheckedChanged
IfchkBurgers.Checked Then
grpBurgers.Visible = True
Else
grpBurgers.Visible = False
End If
End Sub
Private Sub chkFries_CheckedChanged(ByValsender As Object,ByVal e As EventArgs) HandleschkFries.CheckedChanged
IfchkFries.Checked Then
grpFries.Visible = True
Else
grpFries.Visible = False
End If
End Sub
Private Sub chkDrinks_CheckedChanged(ByValsender As Object,ByVal e As EventArgs) HandleschkDrinks.CheckedChanged
IfchkDrinks.Checked Then
grpDrinks.Visible = True
Else
grpDrinks.Visible = False
End If
End Sub
Private Sub btnCompute_Click(ByValsender As Object,ByVal e As EventArgs) HandlesbtnCompute.Click
Dim sumAs Double
IfchkBurgers.Checked Then
IfradRegular.Checked Then
sum += 4.19
ElseIfradCheese.Checked Or radBacon.Checked Then
sum += 4.79
ElseIfradBaconandCheese.Checked Then
sum += 5.39
EndIf
End If
IfchkFries.Checked Then
IfradSmall.Checked Then
sum += 2.39
ElseIfradMedium.Checked Then
sum += 3.09
ElseIfradLarge.Checked Then
sum += 4.99
EndIf
End If
IfchkDrinks.Checked Then 'There was an error
IfradSoda.Checked Then
sum += 1.69
ElseIfradBottledWater.Checked Then 'There was an error
sum += 1.49
EndIf
End If
txtCost.Text = sum.ToString("C")
End Sub
EndClass
Comments
Leave a comment