Question: 5 . 1 3 . 2 : Default parameters: Calculate splitting a check between diners. Write a split _ check function that returns the amount

5.13.2: Default parameters: Calculate splitting a check between diners.
Write a split_check function that returns the amount that each diner must pay to cover the cost of the meal.
The function has 4 parameters:
bill: The amount of the bill.
people: The number of diners to split the bill between.
tax_percentage: The extra tax percentage to add to the bill.
tip_percentage: The extra tip percentage to add to the bill.
The tax or tip percentages are optional and may not be given when calling split_check. Use default parameter values of 0.15(15%) for tip_percentage, and 0.09(9%) for tax_percentage. Assume that the tip is calculated from the amount of the bill before tax.
Sample output with inputs: 252
Cost per diner: 15.5
Sample output with inputs: 10020.0750.21
Cost per diner: 64.25

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