Question
Simple programing using python. Thank you. Write a menu-driven program for Food Court. ( You need to use functions! ) Display the food menu to
Simple programing using python. Thank you.
Write a menu-driven program for Food Court. (You need to use functions!)
- Display the food menu to a user (Just show the 5 options' names and prices - No need to show the Combos or the details!)
- Ask the user what he/she wants and how many of it. (Check the user inputs) AND Use strip() function to strip your inputs.
- Keep asking the user until he/she chooses the end order option.
(You can pass quantity1, quantity2, quantity3, quantity4 & quantity5 to save the quantities of the orders)
- Calculate the price.
- Ask the user whether he/she is a student or a staff. There is no tax for students and 9% tax for staffs. Add the tax price to the total price.
Tax | Cupertino | 9.000% | Santa Clara |
- Display the bill to the user. The bill includes:
- The food items
- The quantities
- The cost of them
- The total before tax
- Tax amount
- Total price after tax
You can have your own design but you need to have a main function and get started from the main function.
For example:
def main():
displayMenu()
.
.
displayBill(..)
main()
or
if __name__ == "__main__": main()
The name of functions also up to your design but they should show what the functions do.
- Only display 2 decimal points when displaying all the numbers.
- Put at least two outputs (results after you run your code) at the end of your code as a multi-line comment.
- Don't forget to put your name and a short description of your code on the top on your code.
- Don't forget to test your code with Positive and Negative Testing! (For more information see this page Testing)
Submit your code here.
PreviousNext
main() show_menu get_inputs compute_bill print_bill main()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