def get_change(cash_received: float, to_pay: float) -> float: ' ' ' Calculates total change to return to user. Total change must be multiples of Australian currency (banknote and coins) Values for banknotes: $5, $10, $20, $50, $100 Values for cents: 5 cents, 10 cents, 20 cents, 50 cents, $1, $2 Note: Krusty is greedy and doesn't want to lose money giving change. The function should not return more change than the customer is owed. Parameters cash_received: float, amount of cash received from user to_pay: float, amount owed for purchases Returns total_change: float, amount to return to user (Australian currency) >>> print(get_change(30.0, 26.52)) 3.45
def get_change(cash_received: float, to_pay: float) -> float: ' ' ' Calculates total change to return to user. Total change must be multiples of Australian currency (banknote and coins) Values for banknotes: $5, $10, $20, $50, $100 Values for cents: 5 cents, 10 cents, 20 cents, 50 cents, $1, $2 Note: Krusty is greedy and doesn't want to lose money giving change. The function should not return more change than the customer is owed. Parameters cash_received: float, amount of cash received from user to_pay: float, amount owed for purchases Returns total_change: float, amount to return to user (Australian currency) >>> print(get_change(30.0, 26.52)) 3.45
Chapter12: Exception Handling
Section: Chapter Questions
Problem 11PE
Related questions
Question
can i get help with this question please
def get_change(cash_received: float, to_pay: float) -> float:
' ' '
Calculates total change to return to user. Total change must be multiples of Australian currency (banknote and coins)
Values for banknotes: $5, $10, $20, $50, $100
Values for cents: 5 cents, 10 cents, 20 cents, 50 cents, $1, $2
Note: Krusty is greedy and doesn't want to lose money giving change.
The function should not return more change than the customer is owed.
Parameters
cash_received: float, amount of cash received from user
to_pay: float, amount owed for purchases
Returns
total_change: float, amount to return to user (Australian currency)
>>> print(get_change(30.0, 26.52))
3.45
' ' '
pass
Expert Solution
This question has been solved!
Explore an expertly crafted, step-by-step solution for a thorough understanding of key concepts.
Step by step
Solved in 3 steps with 2 images
Knowledge Booster
Learn more about
Need a deep-dive on the concept behind this application? Look no further. Learn more about this topic, computer-science and related others by exploring similar questions and additional content below.Recommended textbooks for you
EBK JAVA PROGRAMMING
Computer Science
ISBN:
9781337671385
Author:
FARRELL
Publisher:
CENGAGE LEARNING - CONSIGNMENT
Np Ms Office 365/Excel 2016 I Ntermed
Computer Science
ISBN:
9781337508841
Author:
Carey
Publisher:
Cengage
COMPREHENSIVE MICROSOFT OFFICE 365 EXCE
Computer Science
ISBN:
9780357392676
Author:
FREUND, Steven
Publisher:
CENGAGE L
EBK JAVA PROGRAMMING
Computer Science
ISBN:
9781337671385
Author:
FARRELL
Publisher:
CENGAGE LEARNING - CONSIGNMENT
Np Ms Office 365/Excel 2016 I Ntermed
Computer Science
ISBN:
9781337508841
Author:
Carey
Publisher:
Cengage
COMPREHENSIVE MICROSOFT OFFICE 365 EXCE
Computer Science
ISBN:
9780357392676
Author:
FREUND, Steven
Publisher:
CENGAGE L