Public Class frmMenu
'define variables and constants for menu
Const RegularPrice As Decimal = 8.5 'Can be easily changed if needed
Const GourmetPrice As Decimal = RegularPrice + 5
Dim OrderArray(11, 2) As String 'stored as name quantity price
Public Sub populatemenu()
'store pizza names - Change names below when new pizza is added to menu
'Regular
OrderArray(0, 0) = "MARGHERITA"
OrderArray(1, 0) = "PEPPERONI"
OrderArray(2, 0) = "HAWAIIAN"
OrderArray(3, 0) = "HAM + CHEESE"
OrderArray(4, 0) = "TROPICAL VEGGIE"
OrderArray(5, 0) = "CLASSIC CHEESE"
OrderArray(6, 0) = "CHEESY GARLIC"
'Gourmet
OrderArray(7, 0) = "BBQ CHICKEN & BACON DELUXE"
OrderArray(8, 0) = "BUFFALO CHICKEN DELUXE"
OrderArray(9, 0) = "SUMMER SHRIMP DELUXE"
OrderArray(10, 0) = "HOT + SPICY MEAT DELUXE"
OrderArray(11, 0) = "SEAFOOD DELUXE"
'add prices to array
Dim i As Integer
For i = 0 To 6
OrderArray(i, 2) = RegularPrice
Next
For i = 7 To 11
OrderArray(i, 2) = GourmetPrice
Next
'add names to menu
For i = 1 To 12
Dim myLabel As Label = CType(Me.Controls("lblpizza" & i), Label)
myLabel.Text = i & " " & OrderArray(i - 1, 0)
Next
'add prices in a similar way to above but format according to this (item.ToString("C"))
For i = 12 To 18
Dim myLabel As Label = CType(Me.Controls("Label" & i), Label)
myLabel.Text = RegularPrice.ToString("C")
Next
For i = 19 To 23
Dim myLabel As Label = CType(Me.Controls("Label" & i), Label)
myLabel.Text = GourmetPrice.ToString("C")
Next
End Sub
End Class