Question: Complete the function blood_donor, which determines whether a person is able to donate blood. A person is eligible to donate blood if his/her age

Complete the function blood_donor, which determines whether a person is able to donate blood. A person is [ ]] 1 def blood donor (age, mass, requested_blood_type, donor_blood_type): 2 return 'Error

Complete the function blood_donor, which determines whether a person is able to donate blood. A person is eligible to donate blood if his/her age is 18 or over and his/her mass ("weight") is greater than 48 kilograms. The function takes four arguments: age, which gives the prospective donor's age mass, which gives the prospective donor's mass in kilograms requested_blood_type, which gives the requested blood type donor_blood_type, which gives the prospective donor's blood type The function returns one of several strings, depending on the inputs. If the donor's eligibility is satisfied and his/her blood type matches the requested blood type, return 'match'. Otherwise, check for ineligibility in the following order and return the first reason for ineligibility, if any: 'too young, too light' (both the age and the mass are too low) 'too young' (age is too low) 'too light' (mass is too low) "mismatch' (requested_blood_type and donor_blood_type don't match) Examples: Function Call blood donor (21, 50, 'A' blood donor (16, 50, blood donor (20, 48, blood donor (17, 47, blood donor (21, 70, Return value natch too young too light too young, too light nismatch Activate [ ]] 1 def blood donor (age, mass, requested_blood_type, donor_blood_type): 2 return 'Error" # DELETE THIS LINE and start coding here. # Remember: end all of your functions with a return statement, not a print statement! 4 5 6 # Test cases 7 print (blood_donor (21, 50, 'A', 'A')) 8 print (blood donor (16, 50, 'A', 'B')) 'A')) 9 print (blood_donor (20, 48, '0', 10 print (blood_donor (17, 47, 'B', 'B')) 11 print (blood_donor (21, 70, 'A', 'B')) - Part 2: Buying in Bulk (10 points) Customers can buy computer screens in bulk from Computer Monitor Paradise, Inc. Customers receive discounts based on the number of monitors they buy. Complete the function bulk purchase, which takes two arguments: monitors_to_buy, which is the number of computer monitors a customer wants to purchase; and monitor_cost, which is the non-discounted cost to buy a single monitor. The function computes and returns the total cost for the purchase according to the following rules: of Monitors Cost in $ 1-99 100-199 200+ Examples: monitor cost per monitor monitor_cont for each of the first 100 monitors and 20% discount on the rest 20% discount on the first 200 monitors and 35% discount on the rest Function Call bulk purchase(80, 75) bulk purchase (175, 120) bulk purchase (228, 180) Expected Output $6000.00 $19200.00 $32076.00 Activate Wi Go to Settings

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock

Heres the code for the blooddonor function ... View full answer

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 Programming Questions!