Your assignment is to write a pizza ordering system for the mighty Pizza Yurt chain. You must implement the program using separate functions for each major component of the program. In addition, we will continue using lots of loops and tests.
Your final program should do the following:
An important part of this assignment is breaking down the problem into smaller steps and writing a function for each step. Here are examples of possible functions you may want to write:
get_num_pizzas checks to make sure valid number is entered, returns int.
get_pizza_size checks to make sure valid letter is entered, returns char.
print_order shows total small, medium, and large pizzas and total
toppings.
print_receipt calculates cost of all items, subtotal, tax, and total.
calc_tax determines the tax given a double and returns a double.
Here is a sample run of the program. The user's input is shown in bold:
Welcome to Pizza Yurt!
This is order 1.
How many pizzas would you like? -3
Please enter a positive number, or 0 to quit.
How many pizzas would you like? 2
What size pizza would you like (S, M, or L) for pizza 1 ? S
How many toppings would you like on pizza 1 ? 4
What size pizza would you like (S, M, or L) for pizza 2 ? X
You may choose from S, M, or L.
What size pizza would you like (S, M, or L) for pizza 2 ? L
How many toppings would you like on pizza 2 ? 2
Your order is:
1 small pizza
1 large pizza
6 toppings
Is this correct? Y
Receipt:
Pizza Yurt
Order #1
1 small pizza $ 5.00
1 large pizza $ 9.00
6 toppings $ 4.50
subtotal $ 18.50
tax $ 1.85
TOTAL $ 20.35
This is order 2
How many pizzas would you like? 0
Thanks for working at Pizza Yurt!
Hand in a printout of your final program and a sample run demonstrating all the features of your program.