Project #3
Internet Pizza
(Due 11 October 2006)
We have decided to start a pizza parlor which accepts orders across the Internet. Customers are to interact with a program that you must write so they can order their pizzas. Your program is responsible for repeatedly taking orders from a customer until the customer indicates there are no more orders. The program is to ask the customer for specifications on each pizza, calculate the pizza's cost and display what the customer must pay. To obtain the specifications, the program must ask for the following information:
The size of the pizza
Four sizes are possible: small, medium, large,
or extra (meaning extra large)
The customer must type in one of the size words to indicate the size
The base cost of the pizza is determined by its size: small is $4.99,
medium is $6.99,
large is $8.99, and extra is $11.49
The number of toppings
Each topping adds a specific amount to the cost of the pizza.
Each topping
on a small pizza adds $0.49; the other sizes increase the cost of the topping
my a multiplication factor - on a medium, it is 1.5 * cost of a topping
for small;
on a large, it is 2.2 times; on an extra, it is 3.0 times.
(Note: a real pizza parlor would ask what the toppings are.
But, because the exact
ingredients do not affect the cost, your program need not do this.)
The type of crust
For pizza's with a thick crust, $0.65 is added to the cost. For those
with a thin
crust, there is no additional cost
After determining the cost of a pizza order, state tax must be added. In Pennsylvania, the tax is 6% of the cost. One final element may be added to determine what the customer must pay. Because of the cost of gasoline, the parlor has a $0.50 surcharge for each delivery. So, the program must determine if the pizza is for delivery or pick up and possibly add in the surcharge.
The program should display all the component charges and the total bill for a customer's order. It should then ask the customer if s/he wants to make another order. If the customer indicates that s/he does, the program should obtain the specifications for the next order and display its charges. This should be repeated until the customer indicates there are no more orders.
There is one special requirement for your
program. If the customer mistypes the pizza size by entering anything
other than the four size words, your program should give the customer a
second chance to specify the size. If the customer enters a proper
size on either the first or second try, the program should get the rest
of the order specifications and process the pizza order. If the customer
gets the size wrong twice, the program should display a message and terminate.
Here are a couple examples:
Suppose the customer orders a large pizza
with three toppings on a thin crust to be delivered. The program
should determine that the total cost is $13.46, including $0.73 tax.
$8.99 is the base cost; $3.23 for toppings, and $0.50 for delivery.
Fractions of a cent add another penny.
Suppose the customer orders a small pizza with no toppings on a thick crust and will pick it up. The program should determine the total cost is $5.98, including $0.34 tax. $4.99 is the base cost; $0.65 is added for the thick crust.
Hand in a well-documented printout of your
program and a screen capture of output from several orders. Approximately
three days before the project is due, I will specify a sequence of orders
that I want you to use when you run your program to generate the output
you hand in. Also, copy the .cpp file for your program to
the P: drive handin folder. Be sure to name this file after yourself.
I would name mine p3-wolfe.cpp