Pizza Parlor Assignment solution
Pizza Parlor Assignment: You have decided to open your own Pizza Parlor! You are a master pizza maker, however, you have a lot of tasks to keep up with to run a successful pizza parlor business. Below are the items that you need to keep track of to run your business:
You feel dismayed… but then Eureka! You recall that you have programming skills just suited for this type of challenge! Below are some of the requirements for this project: 1. Must use Global Variables (*Hint* Toppings and crust count) 2. Must use at least one array and one pass by reference function (*Hint you will need more than one for this project) 3. Must comment code and compile program in Linux
Toppings: Topping Quantity on Hand (QOH) 1 Cheese 200 2 Pepperoni 100 3 Mushroom * 100 4 Onions * 100 5 Sausage 100 6 Hamburger 100 7 Bacon Bits * 100 8 Black Olives 100 9 Green Peppers 100 10 Pineapple * 50 * = Premium topping ($1.00 extra) Otherwise included no extra charge
Crust Types: Crust QOH 1 Thin Crust 100 2 Flatbread 100 3 Thick Crust* 100 * = Premium crust ($2.00 extra) Default Pizzas: Pizza Toppings 1 Cheese Cheese Only 2 Pepperoni Pepperoni and Cheese Only 3 Pineapple* Pineapple and Cheese only * = Premium Pizza
Pizza Sizes: Width (in) Common Name Number of Slices
Base Price 1 8 Personal Pan 6 $10.00 2 10 Small 6 $10.00 3 12 Medium 8 $12.00 4 14 Large 10 $14.00 5 16 Extra Large 10 $14.00 6 18 NY Style 12 $16.00
Additional information: • Since you are the sole owner and cook at this restaurant you must keep up with the quantity on hand (QOH) for all of your inventory (toppings and crusts available) To make managing your inventory easier we will assume that if a user orders a thin crust pepperoni pizza that they will only use 1 unit of thin crust, 1 unit cheese, and 1 unit of pepperoni. This would mean that your QOH for those items would now be: 99 units of thin crust, 99 units of cheese, and 99 units of pepperoni.
• Another item that you will need to keep up with as the CEO of your business is the inflow of money! Each pizza size has a base price, the included toppings are no charge, however the premium toppings are $1.00 extra (see tables above). For example, if a user orders a small cheese and bacon bits pizza on thick crust, then the itemized total for that order would look like the following: Item Price 1 10 inch (small) $10.00 1 Thick crust $2.00 extra 2 Cheese Included no charge (NC) 3 Bacon Bits $1.00 extra Total $13.00 • As a courtesy to your patrons in your pizza parlor, you will ask them how many are in their party. This will enable them to split them total bill evenly among themselves at the checkout counter. To build upon the previous example noted above… if they ordered the small cheese and bacon bits pizza, then it can serve up to 6 people. If the number of guests are less than or equal to 6 then the screen needs to output how many each person owes… for the above example, if the user has indicated there are 5 people in his part, then each person would owe: $13.00 / 5 = $2.60. If the user entered a number lower than 1 or more than 6 you need to indicate to the user that this is an invalid number of people in his part since he ordered a small pizza.
• To not wear yourself out, you will limit yourself to only making 4 pizzas. After that the program will exit and it should display how much of each items that you now have on hand (QOH) and how much money you made that night to the screen. See the example input and output code on the next page
Full program example output (and input) Welcome to Pizza Parlor, please enter a number from 1 to 6 to indicate the size pizza you want 4 You have chosen to order a Large Pizza. This will feed 10 people Please enter a number from 1 to 3 to indicate the type of crust you want. 2 You have chosen Flatbread as your crust Please enter a number from 1 to 10 to indicate what toppings you would like on your pizza 1 You have added cheese to your order. Would you like to add more toppings (Y = Yes N = N) Y Please enter a number from 1 to 10 to indicate what toppings you would like on your pizza 2 You have added Pepperoni to your order. Would you like to add more toppings (Y = Yes N = N) Y Please enter a number from 1 to 10 to indicate what toppings you would like on your pizza 4 You have added Onions to your order. Would you like to add more toppings (Y = Yes N = N) N Please enter the number of guests you have in your party 11 I am sorry you must enter a number less than 10 for a large pizza. 10 CONTINUED on next page…
Great your total for today’s order at the Pizza Parlor was $15.00 Would you like an itemized list of your order? (Y = Yes N = No) Y Great your itemized total for your order was as follows: Large Pizza $14.00 Flatbread Crust $NC Cheese Topping $NC Pepperoni Topping $NC Onion Topping $1.00 Total Cost $15.00 The total cost for each of your 10 guests will be $1.50 Would you like to order another pizza? You have 3 Pizzas remaining (Y = Yes N = No) No Thank you for eating at the Pizza Parlor! Please come again soon! My total revenue for the night was $15.00 My new QOH totals are as follows: Toppings QOH: Cheese 199 Pepperoni 99 Mushroom 100 Onions 99 … … Pineapple 50 Crust QOH: Thin 100 Flatbread 99 Thick 100 *Side note* The program will only execute 4 times before exiting automatically since you can only make 4 pizzas a night… Due date for this optional assignment will be 4-15-16.
References Picture:  http://visitironriver.com/mod/biz/files/pizza_parlor.jpg  https://d2nyfqh3g1stw3.cloudfront.net/photos/pizza_19231.jpg
You'll get 1 file (204.6KB)