VB Code Pizza March 2018 IGCSE Computer Science Pre Release
VB Code Pizza March 2018 IGCSE Computer Science Pre Release
Const PbaseNo = 2
Const PtoppingNo = 6
Dim Lstsize(PsizeNo) As String
Dim Lstbase(PbaseNo) As String
Dim TotalNoPizzaOrdered As Integer
Dim TotalNoBaseOrdered As Integer
Dim TotalNoSizeOrdered As Integer
Dim NoOfToppings As Integer
Dim Lsttoppings(PtoppingNo) As String
Dim NextChoice As String
Dim WrongChoice As Boolean
WrongSize = True
WrongToppings = True
WrongBase = True
Lstsize(1) = "small"
Lstsize(2) = "medium"
Lstsize(3) = "large"
Lstbase(1) = "thick"
Lstbase(2) = "thin"
Lsttoppings(1) = "Pepperoni"
Lsttoppings(2) = "Chicken"
Lsttoppings(3) = "Extra cheese"
Lsttoppings(4) = "Mushrooms"
Lsttoppings(5) = "Spinach"
Lsttoppings(6) = "Olives"
NextPizza = True
TotalNoPizzaOrdered = 0
TotalNoBaseOrdered = 0
TotalNoSizeOrdered = 0
While NextPizza = True
Edit = "y"
While Edit = "y"
While WrongSize = True
WrongSize = False
Print "Enter pizza size number from the list below "
For i = 1 To 3
Print i, Lstsize(i)
Next
Psize = InputBox("enter size number 1,2 or 3")
Rem Size = Lstsize(Psize)
MsgBox ("You have ordered: " & TotalNoPizzaOrdered & "no of pizzas " &
"Total base: " & TotalNoBaseOrdered & " Total no of Size: " &
TotalNoSizeOrdered)