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

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!