Need help creating a Pizza ordering program to match the input/output given in examples exactly.
CS303e_Project4 CS 303e Project #4: Pizza Ordering Due: Sunday, April 7, 2019 Points: 100 Purpose: The purpose of this project is for you to work with classes. You will also be practicing creating a program from a detailed written description. In this assignment you will be practicing: getting user input, writing functions, writing classes, and using lists. Learning Objectives: By the end of this assignment you should be able to: - Design and code a variety of functions - Decide what parameters are need in a given situation - Decide if a return statement is needed in a given situation - Use Lists (and their corresponding built-in functionality) to solve a problem - Design and code a class - Use try except to work with incorrect user input - Take a written description and create the corresponding Python code to solve that problem - Design a small Python program - Read and analyze output and reconstruct the program Pizza Order Program: Welcome to Pie in the Sky Pizza Shoppe! This old time pizza parlor has decided instead of writing down all the orders being called in, they would input the information into a program and have hired to to write it. Instructions: Create a python program that preforms asks the user for a variety of inputs (see sample input below), creates a class object, and stores all the orders in a list. This program has three “modes”: (1) create an order, (2) find and mark complete an order, and (3) display all incomplete (i.e., not done) pizzas. Create an pizza object / order: Ask the user for size of pizza, type of crust, amount of sauce, and the toppings. (Hint: these should be variables/attributes in your class). Unlike all your previous programs, user input can be incorrect for this program, but the program should continue gracefully (i.e., use try except statements and if statements). Your program will assignment a sequential order number to each pizza (first pizza will have an order number of 1, second pizza will have an order number of 2, and so forth). You will be storing all the pizzas ordered each time the program runs in a list. You will use this list to update if the pizza is finished and to display all the unfinished pizzas. To update when a pizza is finished you will looking it up via a valid order number (hint: have a variable/attribute in your class Pizza to represent if the pizza is done or not). Example 1 Input and Output (what is entered by the user is in italics: Welcome to Pie in the Sky Pizza Shoppe! (O)rder a pizza (F)inish an order (D)isplay un-finished orders (E)xit o What size pizza do you want? (S)mall, (M)edium, or (L)arge s What curst do you want? (H)and-tossed, (T)hin, (C)heese Stuffed or (D)eep Dish t How much sauce do you want? (N)one, (E)xtra, or (L)ight l (E)xtra cheese, (M)ushrooms, (G)oat cheese (T)omatoes, (P)ineapple, (F)resh veggies (K)alamata olives, (G)reen olives, (B)lack olives B(A)con, Pepperon(I), (H)am, Bee(F) Enter a topping or done: k Enter a topping or done: E Enter a topping or done: done This order number is 1 Welcome to Pie in the Sky Pizza Shoppe! (O)rder a pizza (F)inish an order (D)isplay un-finished orders (E)xit o What size pizza do you want? (S)mall, (M)edium, or (L)arge m What curst do you want? (H)and-tossed, (T)hin, (C)heese Stuffed or (D)eep Dish h How much sauce do you want? (N)one, (E)xtra, or (L)ight n (E)xtra cheese, (M)ushrooms, (G)oat cheese (T)omatoes, (P)ineapple, (F)resh veggies (K)alamata olives, (G)reen olives, (B)lack olives B(A)con, Pepperon(I), (H)am, Bee(F) Enter a topping or done: A Enter a topping or done: G Enter a topping or done: I Enter a topping or done: DONE This order number is 2 Welcome to Pie in the Sky Pizza Shoppe! (O)rder a pizza (F)inish an order (D)isplay un-finished orders (E)xit F Please enter the order number: 2 Welcome to Pie in the Sky Pizza Shoppe! (O)rder a pizza (F)inish an order (D)isplay un-finished orders (E)xit d 1 is not complete. Welcome to Pie in the Sky Pizza Shoppe! (O)rder a pizza (F)inish an order (D)isplay un-finished orders (E)xit e Process finished with exit code 0 Example 2 Input and Output (what is entered by the user is in italics: Welcome to Pie in the Sky Pizza Shoppe! (O)rder a pizza (F)inish an order (D)isplay un-finished orders (E)xit w Type an O, F, D, or E Welcome to Pie in the Sky Pizza Shoppe! (O)rder a pizza (F)inish an order (D)isplay un-finished orders (E)xit o What size pizza do you want? (S)mall, (M)edium, or (L)arge y That is not a size we have. Try again What size pizza do you want? (S)mall, (M)edium, or (L)arge m What curst do you want? (H)and-tossed, (T)hin, (C)heese Stuffed or (D)eep Dish w That is not a curst we have. Try again What curst do you want? (H)and-tossed, (T)hin, (C)heese Stuffed or (D)eep Dish d How much sauce do you want? (N)one, (E)xtra, or (L)ight p That is not a level of sauce we have. Try again How much sauce do you want? (N)one, (E)xtra, or (L)ight e (E)xtra cheese, (M)ushrooms, (G)oat cheese (T)omatoes, (P)ineapple, (F)resh veggies (K)alamata olives, (G)reen olives, (B)lack olives B(A)con, Pepperon(I), (H)am, Bee(F) Enter a topping or done: Q That is not a valid input. Try again. Enter a topping or done: t Enter a topping or done: stop That is not a valid input. Try again. Enter a topping or done: done This order number is 1 Welcome to Pie in the Sky Pizza Shoppe! (O)rder a pizza (F)inish an order (D)isplay un-finished orders (E)xit e Example 3 Input and Output (what is entered by the user is in italics: Welcome to Pie in the Sky Pizza Shoppe! (O)rder a pizza (F)inish an order (D)isplay un-finished orders (E)xit d All orders complete Welcome to Pie in the Sky Pizza Shoppe! (O)rder a pizza (F)inish an order (D)isplay un-finished orders (E)xit e Example 3 Input and Output (what is entered by the user is in italics: Welcome to Pie in the Sky Pizza Shoppe! (O)rder a pizza (F)inish an order (D)isplay un-finished orders (E)xit d All orders complete Welcome to Pie in the Sky Pizza Shoppe! (O)rder a pizza (F)inish an order (D)isplay un-finished orders (E)xit o What size pizza do you want? (S)mall, (M)edium, or (L)arge s What curst do you want? (H)and-tossed, (T)hin, (C)heese Stuffed or (D)eep Dish t How much sauce do you want? (N)one, (E)xtra, or (L)ight e (E)xtra cheese, (M)ushrooms, (G)oat cheese (T)omatoes, (P)ineapple, (F)resh veggies (K)alamata olives, (G)reen olives, (B)lack olives B(A)con, Pepperon(I), (H)am, Bee(F) Enter a topping or done: e Enter a topping or done: done This order number is 1 Welcome to Pie in the Sky Pizza Shoppe! (O)rder a pizza (F)inish an order (D)isplay un-finished orders (E)xit f Please enter the order number: 3 That is not a valid order number. Try again Please enter the order number: 2 That is not a valid order number. Try again Please enter the order number: 1 Welcome to Pie in the Sky Pizza Shoppe! (O)rder a pizza (F)inish an order (D)isplay un-finished orders (E)xit e Submission Instructions: • In order to receive full credit, you must submit a .py file (otherwise your assignment cannot be graded and will result in a 0) to Canvas • Assignments are not submitted via email. (Even late assignments). • If you assignment is late, the penalty is 5% per day. (This includes weekends, holidays, etc) The Auto-Grader: • Yes, a computer program will be grading your program! We will be using the Python 3 standard. (Please note: there are some differences between 2 and 3 - make sure you have Python 3) • Your output must match exactly to earn full credit • When your output does not match exactly, you will temporarily be assigned a grade of 0 • Your assignment will be hand checked by the graders and your will earn partial credit (see rubric below) • Please do not email us regarding your grade until after we announce (via Canvas) finalized grades have be posted! • If we have announced grades have been finalized and you still have a zero or other questions regarding your score, please see or contact the TA who posted the grades to discuss your grade (check Piazza for the announcement) • As stated in the syllabus: You have one week from when you announce grades have been posted to contest the grade Hints: • I do not know where to start: 1. Read the entire assignment again. Especially focus on the input/output. Print out the sample input/output. Use a highlighter or a brightly color pin to see what is input from the user and what are output statements of the program 2. Check all the three links below for hints on how to do things in your program 3. Write Pizza class. Attributes variables mentioned in the write up and seen in the input/ output: size of pizza, type of crust, amount of sauce, the toppings, and if the pizza is finished 4. Create functions to display each of the “menus” you see for the program (i.e., the one at the beginning and one for the toppings) 5. Write code to deal with getting user input for the menu 6. Write code to deal with getting user input for the pizza size (and so forth) 7. Continue writing code until complete • Finding if something is in a list (helpful for toppings): https://www.tutorialspoint.com/python/ list_index.htm • Additionally reading on classes: https://jeffknupp.com/blog/2014/06/18/improve-your- python-python-classes-and-object-oriented-programming/ • Classes in a list: https://www.daniweb.com/programming/software-development/code/ 216631/a-list-of-class-objects-python • Write one piece of code at a time (function by function is often helpful way to look at things). DEBUG that piece of code before moving on. This will help significantly. Or comment out a piece of code you are having trouble with until you can ask a TA or the instructor for help. Do not try to write the whole thing and then debug. “Hard code” user input to work on pieces then go back and work with user input can also be helpful • Do not wait until April 5 or 6 to start working on this. Trust me, it will not go well. Or be prepared to spend your entire weekend working on this. Coding under a time crunch and pressure is much more difficult. There is a reason we give you more than a week to work on these. Often there is some “thinking” and “planning” that goes into writing these. Rubric (Total 100 points): Correctly use input statement to get the information: 25 points Correctly display the output: 10 points https://www.tutorialspoint.com/python/list_index.htm https://www