Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

*Note: Python homework: When prompting the user you must always include text which lets the user know what should be inputted. Write a program that

*Note: Python homework:

When prompting the user you must always include text which lets the user know what should be inputted.

Write a program that includes a function named calculate_city_tax that accepts a sales amount as an argument and returns the amount of city tax. The program should include another function named calculate_county_tax that accepts the the sales amount (float) as an argument and returns the amount of county tax. Finally, the program should include another function called calculate_state_tax that the sales amount (float) as an argument and returns the amount of state tax. The returned tax amounts should be rounded to two decimal places. Use docstrings to describe the 3 functions.

The main program should prompt the user to enter the sales amount (float), call the functions and display the city tax, county tax, state tax and total tax. All output should be displayed using an f-string.

The tax rates to be used in the program are the following:

city tax rate = 6.125%

county tax rate = 4.75%

state tax rate = 1.625%

Here is a sample run of the program:

You must include comments in your code following PEP 8. Not including comments in your code or random comments that do not pertain to your code will result in 2 points being deducted.

PreviousNext

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

Step: 3

blur-text-image

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

Machine Learning And Knowledge Discovery In Databases European Conference Ecml Pkdd 2014 Nancy France September 15 19 2014 Proceedings Part 3 Lnai 8726

Authors: Toon Calders ,Floriana Esposito ,Eyke Hullermeier ,Rosa Meo

2014th Edition

3662448440, 978-3662448441

More Books

Students also viewed these Databases questions