Question
Design a function called get_bill_share that will calculate and return the amount each person in a group owes on restaurant charges for food and alcohol
Design a function called get_bill_share that will calculate and return the amount each person in a group owes on restaurant charges for food and alcohol divided equally among them. The function should take three arguments: two floating point values representing the amount of money spent on food and the amount of money spent on alcohol and the number of people sharing the bill.
The function can assume the amount of money owed for both food and alcohol will be $0 or more and the number of people sharing the bill is at least one.
Example:
If the function is called as:
get_bill_share(18.93, 0, 2) it should return the approximate value 9.93825
Do not round the returned value
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started