Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

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

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image_2

Step: 3

blur-text-image_3

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

More Books

Students also viewed these Databases questions

Question

What about leadership lessons from particularly good or bad bosses?

Answered: 1 week ago

Question

When would you use one approach, and when would you use another?

Answered: 1 week ago