Question: enter _ sales _ for _ today: Takes as a parameter a dictionary where the keys are names of items sold and the corresponding values

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 (see the example at the end of the readme)
If an item in the menu doesn't appear in the dictionary, then there were no sales of that item on that day. You don't need to worry about this in this method, but it's important in the next method.
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
Any time this method is called (and the exception isn't raised), exactly one SalesForDay object should be created and added to the list

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!