Answered step by step
Verified Expert Solution
Link Copied!

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, 11.1 Wk 5 Milestone 3(Part 1- More FoodVendor operations)
Instructor note:
STOP!
This chapter [Wk 5(Python)- Project Programming Milestone 3(System integration)] starting with section 11.1 Wk 5 Milestone 3(Part 1- 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 5(Java)- Project Programming Milestone 3(System integration). You can also navigate within the zyBook to Chapter 12, section 12.1 to complete your graded work for week 5.
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 3 milestones: 1) Database setup, 2) User object implementations with database access, and 3) Final system integration.
Milestone 3 consists of 3 labs. In this lab, the remaining operations in FoodVendor.py are implemented. You can use all your files submitted in Milestone 2 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
receipt_number (int type)- receipt number. Initialized to 1000 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 receipt_number to 1000.
create_receipt(list, 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 =21 characters.
Output user's information using the __str__() method from Customer object.
Output receipt number. Receipt number is incremented by 1 every time a receipt is created.
Output current date and time: Day, MM/DD/YY, HH:MM:SS AM/PM.(Hint: 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 25 characters, left aligned. Set the width of price as 5 characters with 2 decimal place.
Output the total cost for guest user. Set the width of "Total" as 25 characters.
Output the subtotal, reward redeemed, and total cost for user with account. Set the width of "Subtotal", "Reward", and "Total" as 25 characters. Reward redeemed value is calculated as 10% of the reward parameter.
Output the credit card number, with the last 4 digits revealed.
Output the reward points earned from the order for user with account. Reward is calculated as 5% 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.
print_order_history(user)
Retrieve order history of user from database. Order history is the receipt number.
Open receipt file and output content of the receipt.
insert_food_item()
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 insert_food_item() output:
Please choose a food category:
Sandwiches - Enter 1
Salads - Enter 2
Drinks - Enter 3
Mexican food - Enter 4
Vegetarian - Enter 5
Return to previous menu - Enter 6
1
Is this a side option (Y/N)? 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: 15.99
Please enter the prep time of food item (in minutes): 8
Do you want to make this item available in daily menu (Y/N)? Y
order_food(user)
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 check-out or exit option is chosen.
Return from method if no food is ordered.
Before check-out, 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

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Introduction to Wireless and Mobile Systems

Authors: Dharma P. Agrawal, Qing An Zeng

4th edition

1305087135, 978-1305087132, 9781305259621, 1305259629, 9781305537910 , 978-130508713

More Books

Students also viewed these Programming questions

Question

Whats the first step?

Answered: 1 week ago