Answered step by step
Verified Expert Solution
Question
1 Approved Answer
A class with the following methods and attributes is to be coded in python: add_items(Food objects) Takes in a list of Food objects and adds
A class with the following methods and attributes is to be coded in python:
add_items(Food objects) Takes in a list of Food objects and adds each of them to the correct part of the menu (For example if a food is an appetizer, it should be added to the CS1301 HOMEWORK 10: OOP appetizer_list). A food is only added to the menu if it is not already on the menu (if a food with the exact same attributes is not already on the menu). Returns a string letting the restaurant know all items were successfully added. This string should be of the following format: "You have added number of items) items to your menu. Your menu now contains fnumber of items on menu total items." Should update total_items str_() Takes in a Menu object Returns a string in the following format: "There are ftotal_items) items on the menu. Appetizers are fappetizer_list). Entrees are (entree_list). Desserts are (dessert_list. add_items(Food objects) Takes in a list of Food objects and adds each of them to the correct part of the menu (For example if a food is an appetizer, it should be added to the CS1301 HOMEWORK 10: OOP appetizer_list). A food is only added to the menu if it is not already on the menu (if a food with the exact same attributes is not already on the menu). Returns a string letting the restaurant know all items were successfully added. This string should be of the following format: "You have added number of items) items to your menu. Your menu now contains fnumber of items on menu total items." Should update total_items str_() Takes in a Menu object Returns a string in the following format: "There are ftotal_items) items on the menu. Appetizers are fappetizer_list). Entrees are (entree_list). Desserts are (dessert_listStep 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