IT Help Desk

Software In The Real World

Pizza Program

You have been asked by the local pizza store (Pizza Pizza) to design an application that will assist employees when taking a pizza order from a customer. The owner has requested that you include the following questions within your program to capture each customer’s pizza order. The following statement should be placed in a command button (within the caption property)that will be located on your screen with the caption Place Pizza Order.

Next double click the command button and insert the following code.

Dim fullname as string

Dim Address as string

fullname = inputbox (“What is the customer’s name?”)

fulladdress = inputbox (“What is the customers address?”)

Keep adding to the above code until you have all 6 items included below.

1)Name

2)Address

3)Size of Pizza – Small, Medium, Large

4)Crust – Thin or Hand Tossed

5)Toppings- Choose 5 of the following toppings to offer Extra Cheese, Mushrooms, Sliced Tomatoes, Green Peppers, Yellow Peppers, Banana Peppers, Red Onions, Eggplant, Olives, Pineapple, Goat Cheese, Corn, Pepperoni, Ham, Sausage, Canadian Bacon, Hamburger, Chicken

6)Delivery or Pickup

-You will need a label to display each of the above questions and then another label to display what the user entered. This will require the use of 12 labels for this section alone.

-After inserting your 12 labels you will go back and double click on the place order command button and at the bottom of that code insert the following lines of code.

Label2.caption = fullname

Lable4.caption = fulladdress

You will continue this code for the other 4 items that will be included within your pizza order.

-5 pictures are required on your form and must relate to pizza or a pizza store. To do this draw an image box on your screen, find a pizza related picture on the web, copy it and paste it into the image box.

-You will need a title at the top of your form that reads: PIZZA, PIZZA this should be a label(capital A in the toolbox) and change the caption property. You may also change the font property to adjust the size, the forecolor property can be changed to adjust the color.

-A total for the order must also be calculated within the program, it is easiest to include this coding section within your Place Pizza Order command button

Double click on the Place Pizza order command button and insert the code found below.

If size = “small” then

msgbox = “$8.00”

End if

If size = “medium” then

msgbox = “$12.00”

End if

If size = “medium” then

msgbox = “$12.00”

End if

-Draw a command button towards the bottom of your screen and change the caption of the button to End . Next you will double click on the End command button and type in the following code:

END.

-Draw another command button towards the bottom of your screen and change the caption of the button to Print . Next you will double click on the Print command button and type in the following code:

Dim Msg ' Declare variable.
On Error GoTo ErrorHandler ' Set up error handler.
PrintForm ' Print form.
Exit Sub
ErrorHandler:
Msg = "The form can't be printed."
MsgBox Msg ' Display message.
Resume Next
End Sub