Answered step by step
Verified Expert Solution
Question
1 Approved Answer
using python, 1 1 . 1 Wk 5 Milestone 3 ( Part 1 - More FoodVendor operations ) Instructor note: STOP! This chapter [ Wk
using python, Wk Milestone Part More FoodVendor operations
Instructor note:
STOP!
This chapter Wk Python Project Programming Milestone System integration starting with section Wk Milestone Part More FoodVendor operations is for students completing the Python path of this capstone project.
If you are following the Java path for the capstone project, please navigate back to Blackboard and find the link to Wk Java Project Programming Milestone System integration You can also navigate within the zyBook to Chapter section to complete your graded work for week
Vendor truck ordering application is a capstone project that allows a food truck company to maintain a food and user database as well as enable customers to place orders.
This project is divided into milestones: Database setup, User object implementations with database access, and Final system integration.
Milestone consists of labs. In this lab, the remaining operations in FoodVendor.py are implemented. You can use all your files submitted in Milestone to complete this lab. Alternatively, copy and paste all the attributes and instance methods created in your recent submissions to the new template files provided here.
To include the new operations, FoodVendor.py has the following extra specifications:
Attribute
receiptnumber int type receipt number. Initialized to at the start of the program. Value is incremented by one when an order is made.
Instance methods
init
Default constructor of FoodVendor to initialize receiptnumber to
createreceiptlist user, reward
Create a new text file with file name: FoodVendorReceiptX.txt where X is the receipt number of the user.
Output the company name, "FOOD VENDOR", with width characters.
Output user's information using the str method from Customer object.
Output receipt number. Receipt number is incremented by every time a receipt is created.
Output current date and time: Day, MMDDYY HH:MM:SS AMPMHint: use the datetime module from Python
Output the list of food item names along with prices. Food item names are stored in parameter list. Set the width of name as characters, left aligned. Set the width of price as characters with decimal place.
Output the total cost for guest user. Set the width of "Total" as characters.
Output the subtotal, reward redeemed, and total cost for user with account. Set the width of "Subtotal", "Reward", and "Total" as characters. Reward redeemed value is calculated as of the reward parameter.
Output the credit card number, with the last digits revealed.
Output the reward points earned from the order for user with account. Reward is calculated as of the total cost.
Output the expected wait time.
Output a thank you statement.
For user with account, update new reward points and order history in customer object and database.
For details on receipt format, refer to the receipt samples from existing users provided in the Additional files section.
printorderhistoryuser
Retrieve order history of user from database. Order history is the receipt number.
Open receipt file and output content of the receipt.
insertfooditem
Prompt the user to choose a food category.
Ask if the new item is a side option. Append option" to the category name for side option items. Drinks does not have side options.
Prompt the user to input information of the new item.
Insert the new item to the database.
Ex of insertfooditem output:
Please choose a food category:
Sandwiches Enter
Salads Enter
Drinks Enter
Mexican food Enter
Vegetarian Enter
Return to previous menu Enter
Is this a side option YN N
Please enter the name of food item: Spicy Tuna
Please enter the description of food item: Seared tuna with flaming hot sauce.
Please enter the price of food item:
Please enter the prep time of food item in minutes:
Do you want to make this item available in daily menu YN Y
orderfooduser
Declare a list to save the names ordered items.
Prompt the user to choose a food category.
Display daily menu for the chosen food category.
Prompt the user to input the name of any menu item or "None" to return.
Add the item's name to the list if item exists and is available.
Display daily menu for the side options for the category. Drinks does not have any options.
Prompt the user to input any menu item or "None".
Add the side option item's name to the list if item exists and is available.
Repeat the order process until the checkout or exit option is chosen.
Return from method if no food is ordered.
Before checkout, prompt the guest user to input payment information credit card number, expiration date, billing address, phone number, and email address
For user with account, display reward points the user has and prompt the us
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started