Question: A library charges overdue fees for a borrowed book using the following fee schedule: less than 4 days late: 1 dollar per day 4 to
A library charges overdue fees for a borrowed book using the following fee schedule:
less than days late: dollar per day
to days late: dollars per day for all days, including the first days
more than days late: dollars per day for all days, including the first days
Borrowers of books are in one of these age groups: CHILD, ADULT, or SENIOR. A CHILD gets charged only half of the fees and a SENIOR gets charged only one quarter of the fees. An ADULT pays the full fee.
Complete the following function according to the description above and the docstring below.
CHILD 'child'
ADULT 'adult'
SENIOR 'senior'
def overduefeesdayslate: int, agegroup: str float:
Return the fees for a book that is dayslate days late for a borrower
in the age group agegroup.
Preconditions:
dayslate
agegroup is one of CHILD, ADULT or SENIOR
overduefees SENIOR # days late, SENIOR borrower
overduefees ADULT # days late, ADULT borrower
Step by Step Solution
There are 3 Steps involved in it
1 Expert Approved Answer
Step: 1 Unlock
Question Has Been Solved by an Expert!
Get step-by-step solutions from verified subject matter experts
Step: 2 Unlock
Step: 3 Unlock
