You are on page 1of 2

Public Class Form1

Const Regular As Decimal = 6


Const Large As Decimal = 10
Const OneTopping As Decimal = 1
Const TwoTopping As Decimal = 1.75
Const ThreeTopping As Decimal = 2.5
Const FourTopping As Decimal = 3.25
Const Delivery As Decimal = 1.5
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs)
Handles Button1.Click
Static OrderNumber As Integer = 1
Dim NumTopping As Integer
Dim ToppingPrice As Decimal
Dim PizzaPrice As Decimal
If RadioButton6.Checked Then
PizzaPrice = Large + ToppingPrice
Else
PizzaPrice = Regular + ToppingPrice
End If
Label1.Text = "Order Number"
Label2.Text = OrderNumber
Label3.Text = "Price $"
Label4.Text = PizzaPrice
If CheckBox4.Checked = True Then
NumTopping += 1
End If
If CheckBox3.Checked = True Then
NumTopping += 1
End If
If CheckBox2.Checked = True Then
NumTopping += 1
End If
If CheckBox1.Checked = True Then
NumTopping += 1
End If
Select Case NumTopping
Case 1
ToppingPrice = OneTopping
Case 2
ToppingPrice = TwoTopping
Case 3
ToppingPrice = ThreeTopping
Case 4
ToppingPrice = FourTopping
End Select
If RadioButton6.Checked Then
PizzaPrice = Large + ToppingPrice
Else
PizzaPrice = Regular + ToppingPrice
End If
If RadioButton2.Checked = True Then
PizzaPrice = Large + Delivery
Else
PizzaPrice = Regular + Delivery
End If
Label1.Text = "Order Number"

Label2.Text = OrderNumber
Label3.Text = "Price $"
Label4.Text = PizzaPrice
End Sub
Private Sub Button2_Click(ByVal sender As System.Object, ByVal e As System.EventArgs)
Handles Button2.Click
RadioButton6.Checked = False
RadioButton5.Checked = True
RadioButton1.Checked = True
RadioButton2.Checked = False
CheckBox4.Checked = False
CheckBox3.Checked = False
CheckBox2.Checked = False
CheckBox1.Checked = False
Label1.Text = Nothing
Label2.Text = Nothing
Label3.Text = Nothing
Label4.Text = Nothing
End Sub
End Class

You might also like