The Strawberry Stand methods are: * init method - takes one parameter, the name of the stand; initializes the name to that value, initializes current day to zero, initializes the menu to an empty dictionary, and initializes the sales record to an empty list * a get method for the name: get_name() * add_menu_item - takes as a parameter a MenuItem object and adds it to the menu dictionary. New items can be added to the menu on any day * enter_sales_for_today - takes as a parameter a dictionary where the keys are names of items sold and the corresponding values are how many of the item were sold. If an item in the menu doesn't appear in the dictionary, then there were no sales of that item on that day. If the name of any item sold doesn't match the name of any MenuItem in the dictionary of MenuItem objects, this method should do nothing except raise an **InvalidSalesItemError** (you'll need to define this exception class). Otherwise, it should create a new SalesForDay object using the current day and the dictionary that was passed in, add that object to the list of SalesForDay objects, and then increment the current day by 1 * sales_of_menu_item_for_day - takes as a parameter an integer representing a particular day and the name of a menu item. It returns the number of that item sold on that day. This method will use the given day to find the corresponding SalesForDay object in the list and then call its get_sales_dict method to get the dictionary of sales for that day. It will then look for the item name in the dictionary, taking into account that if an item in the menu doesn't appear in the dictionary, then there were no sales of that item on that day * total_sales_for_menu_item - takes as a parameter the name of a menu item and returns the total number of that item sold over the history of the stand. This method can make use of sales_of_menu_item_for_day * total_profit_for_menu_item - takes as a parameter the name of a menu item and returns the total profit on that item over the history of the stand. The profit for any item sold is the selling price of the item minus the wholesale cost of the item. This method can make use of total_sales_for_menu_item * total_profit_for_stand - takes no parameters and returns the total profit on all items sold over the history of the stand. This method can make use of total_profit_for_menu_item file must include a main function. that runs if the file is run as a script, but not if it's imported to another file. Your main function should: * create a StrawberryStand object * create one or more MenuItem objects and add them to the StrawberryStand's menu * create a dictionary of sales for the day that includes sales of at least one item that isn't in the menu * try calling enter_sales_for_today(), passing that sales dictionary as the argument * If an InvalidSalesItem is raised, it should be caught with a try/except that prints an explanatory message for the user (otherwise the function should proceed normally)

Computer Networking: A Top-Down Approach (7th Edition)
7th Edition
ISBN:9780133594140
Author:James Kurose, Keith Ross
Publisher:James Kurose, Keith Ross
Chapter1: Computer Networks And The Internet
Section: Chapter Questions
Problem R1RQ: What is the difference between a host and an end system? List several different types of end...
icon
Related questions
Question

In python. please include docstring.

The Strawberry Stand methods are:
* init method - takes one parameter, the name of the stand; initializes the name to that value, initializes current day to zero, initializes the menu to an empty dictionary, and initializes the sales record to an empty list
* a get method for the name: get_name()
* add_menu_item - takes as a parameter a MenuItem object and adds it to the menu dictionary. New items can be added to the menu on any day
* enter_sales_for_today - takes as a parameter a dictionary where the keys are names of items sold and the corresponding values are how many of the item were sold. If an item in the menu doesn't appear in the dictionary, then there were no sales of that item on that day. If the name of any item sold doesn't match the name of any MenuItem in the dictionary of MenuItem objects, this method should do nothing except raise an **InvalidSalesItemError** (you'll need to define this exception class). Otherwise, it should create a new SalesForDay object using the current day and the dictionary that was passed in, add that object to the list of SalesForDay objects, and then increment the current day by 1
* sales_of_menu_item_for_day - takes as a parameter an integer representing a particular day and the name of a menu item. It returns the number of that item sold on that day. This method will use the given day to find the corresponding SalesForDay object in the list and then call its get_sales_dict method to get the dictionary of sales for that day. It will then look for the item name in the dictionary, taking into account that if an item in the menu doesn't appear in the dictionary, then there were no sales of that item on that day
* total_sales_for_menu_item - takes as a parameter the name of a menu item and returns the total number of that item sold over the history of the stand. This method can make use of sales_of_menu_item_for_day
* total_profit_for_menu_item - takes as a parameter the name of a menu item and returns the total profit on that item over the history of the stand. The profit for any item sold is the selling price of the item minus the wholesale cost of the item. This method can make use of total_sales_for_menu_item
* total_profit_for_stand - takes no parameters and returns the total profit on all items sold over the history of the stand. This method can make use of total_profit_for_menu_item

file must include a main function. that runs if the file is run as a script, but not if it's imported to another file. Your main function should:

* create a StrawberryStand object
* create one or more MenuItem objects and add them to the StrawberryStand's menu
* create a dictionary of sales for the day that includes sales of at least one item that isn't in the menu
* try calling enter_sales_for_today(), passing that sales dictionary as the argument
* If an InvalidSalesItem is raised, it should be caught with a try/except that prints an explanatory message for the user (otherwise the function should proceed normally)

Expert Solution
trending now

Trending now

This is a popular solution!

steps

Step by step

Solved in 2 steps with 2 images

Blurred answer
Knowledge Booster
Stack operations
Learn more about
Need a deep-dive on the concept behind this application? Look no further. Learn more about this topic, computer-engineering and related others by exploring similar questions and additional content below.
Recommended textbooks for you
Computer Networking: A Top-Down Approach (7th Edi…
Computer Networking: A Top-Down Approach (7th Edi…
Computer Engineering
ISBN:
9780133594140
Author:
James Kurose, Keith Ross
Publisher:
PEARSON
Computer Organization and Design MIPS Edition, Fi…
Computer Organization and Design MIPS Edition, Fi…
Computer Engineering
ISBN:
9780124077263
Author:
David A. Patterson, John L. Hennessy
Publisher:
Elsevier Science
Network+ Guide to Networks (MindTap Course List)
Network+ Guide to Networks (MindTap Course List)
Computer Engineering
ISBN:
9781337569330
Author:
Jill West, Tamara Dean, Jean Andrews
Publisher:
Cengage Learning
Concepts of Database Management
Concepts of Database Management
Computer Engineering
ISBN:
9781337093422
Author:
Joy L. Starks, Philip J. Pratt, Mary Z. Last
Publisher:
Cengage Learning
Prelude to Programming
Prelude to Programming
Computer Engineering
ISBN:
9780133750423
Author:
VENIT, Stewart
Publisher:
Pearson Education
Sc Business Data Communications and Networking, T…
Sc Business Data Communications and Networking, T…
Computer Engineering
ISBN:
9781119368830
Author:
FITZGERALD
Publisher:
WILEY