Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Progressive Taxation Now that we've made so much money with our investment, it's time to pay taxes on it. Write a function with a parameter

image text in transcribedimage text in transcribed

Progressive Taxation Now that we've made so much money with our investment, it's time to pay taxes on it. Write a function with a parameter income that calculates the amount of income tax owed according to the specified tax brackets below: income cap marginal tax rate 10000 0.00 (0%) 40000 0.12 (12%) 85000 0.22 (22%) 163000 0.24 (24%) 200000 0.32 (32%) 500000 0.35 (35%) 100000000 0.37 (37%) How Tax Brackets Work A tax bracket is a range of income based on an income cap. Each bracket is taxed at a different marginal tax rate, meaning that only the part of your income that falls within a specific tax bracket gets taxed by the corresponding marginal tax rate for that tax bracket. For example, if income = $150,000, the first $10,000 that fall in the tax bracket [0, 10000] would be taxed at 0%, the next $30,000 that fall in the tax bracket (10000, 40000] would be taxed at 12%, the next $45,000 that fall in the tax bracket (40000, 85000) would be taxed at 22%, and the remaining $65,000 that fall in the tax bracket (85000, 163000] would be taxed at 24%. Your total tax owed would be the sum of the tax amounts at each tax bracket. So if income = $150,000, then tax owed = (30,000 * 0.12) + (45,000 * 0.22) + (65,000 * 0.24) = $29100. For more information on how tax brackets work, read more here. This function could be implemented with a while loop or with a series of if or if/elif/else statements. You can decide how you want to implement the function. (Note: you might find that this function is much more straight forward if you implement it using if statesments (or if/elif/else).) Before you begin writing any code, try writing out the pseudocode for your function. Think about how you would calculate the taxed owed if you did the math by hand and use this to help you in the implementation. #income cap marginal tax rate # [0, 10000] 0.00 (0%) # (10000, 40000] 0.12 (12%) # (40000, 85000] 0.22 (22%) # (85000, 163000) 0.24 (24%) # (163000, 200000] 0.32 (32%) # (200000, 500000] 0.35 (35%) # (500000, 100000000] 0.37 (37%) def tax(income): - Given an income amount as a whole number where

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

More Books

Students also viewed these Databases questions

Question

Create an argument for Freuds greatest legacy ?

Answered: 1 week ago

Question

What is management growth? What are its factors

Answered: 1 week ago