Question: Building a Lemondade Stand in Python. I have three classes, MenuItem, SalesForDay, and Lemondade Stand. All data members should be marked as private. This is
Building a Lemondade Stand in Python. I have three classes, MenuItem, SalesForDay, and Lemondade Stand. All data members should be marked as private.
This is what I need help with--methods inside the Lemonade Stand class:
- 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 the name of any item sold doesn't match the name of any MenuItem in the menu, it raises an InvalidSalesItemError (you'll need to define this exception class). Otherwise, it creates a new SalesForDay object, using the current day and the dictionary that was passed in, adds that object to the list of SalesForDay objects, and then increments the current day by 1
- get_sales_dict_for_day - takes as a parameter an integer representing a particular day, and returns the dictionary of sales for that day (not a SalesForDay object)
- 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
- 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
- total_profit_for_stand - takes no parameters and returns the total profit on all items sold over the history of the stand
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
