Question: Python programming Part IIl: Chez Wolfi (20 points) Write a function cafe day ) that which takes one argument, orders, which is a list of

 Python programming Part IIl: Chez Wolfi (20 points) Write a function

cafe day ) that which takes one argument, orders, which is a

Python programming

Part IIl: Chez Wolfi (20 points) Write a function cafe day ) that which takes one argument, orders, which is a list of drink orders for the day at a caf. The list orde ra contains one or more sub-lists, in whicheach sub-list represents a particular drink order. In each sub-list, there are four elements, in this order 1. A string that indicales the customer's membership, which will be one of these three categories Platinum membership is represented by the letter . P Gold membership is represented by the lelter G . Silver membership is represented by the lener $ 2. An integer that represents the number of large drinks for the particular order. CSE 101- Fall 2017 Lab #5 Page 3 3. An integer that represents the number of medium drinks for the particular order 4. An integer that represents the number of small drinks for the particular order Your function should process all orders, then return a flouting point number that represents the revenue generated for the day in dollars. Don't round the return value! The prices for different sizes are as follows Drink Size Price $3 Medium $2.50 Small In addition, there will he different privileges depending on different memberships, as described below: Membership Privilege PlatinumIf the customer purchases s or more Large drinks, OR 4 or more medium drnks, then heshe gets at most 3 free small drinks Ir the customer purchases at least lo drinks (in arny combination of smali, medium and large) then he/she gets a 20% discount Silver 1The customerreceives Hoff oTalproe regardless ofnum erofdrinksordered Invalid values: Your function should be able to handle invalid values outlined helow. In these cases, skip the entine drink order and continue to the next one. Valid drink orders have the follow ing characteristics . Each suh-list has exactly four values . The first element in the sub-list, which is the membership, is one of the three strings 'P . ro' ar 's (alt lowercase letters are invalid). . The number of drinks for all thee sizes is greater than or equal to zero. If the orders list is empty, the function should simply return o. 0 Examples

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!