Question
Design a function called get_tax that will calculate and return the tax owed on restaurant charges for food and alcohol. The function should take two
Design a function called get_tax that will calculate and return the tax owed on restaurant charges for food and alcohol. The function should take two floating point values representing the amount of money spent on food and the amount of money spent on alcohol in this order.
The function should calculate and return the total tax owing based on the following rules:
-Restaurants are required to charge 5% GST and no PST on food sales.
-Restaurants are required to charge at 5% GST and 10% PST on alcohol sales.
The function can assume the amount of money owed for both food and alcohol will be $0 or more.
Example:
If the function is called as:
get_tax(28.75, 45.98) it should return the approximate value 8.3345
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