Answered step by step
Verified Expert Solution
Question
1 Approved Answer
In the U . S . , all earned income is subject to federal income tax. The tax system is divided into brackets so that
In the US all earned income is subject to federal income tax. The tax system is divided into
brackets so that higher earners pay a higher percentage of their income in tax. For the
tax year which is what youre filing taxes for in Spring the brackets are set up like this
for a single filer:
Income Tax Rate
Up to $
Over $ up to $
Over $ up to $
Over $ up to $
Over $ up to $
Over $ up to $
Over $
A common misconception is that if youre near the border between two brackets, its advan
tageous to refuse a small raise because you would end up with less aftertax pay if you get
bumped into the next higher bracket. This is totally false. The tax rates in the table above are
marginal, which means they apply only to the portions of income in each range, rather than
all of the income.
Thus, earning more income will generally result in more aftertax pay. There are some excep
tions, such as an income increase disqualifying a taxpayer for the Earned Income Tax Credit
but we wont consider those special cases here.
If youre interested in US tax laws, see https:wwwirs.govcreditsdeductionsindividuals
earnedincometaxcredit for more info about the EITC. Its good bedtime reading.
Page of
Note that federal tax is not the only thing withheld from your paycheck. There are also deduc
tions for Social Security and Medicare known as FICA taxes state income tax thankfully
zero if you live in Tennessee retirement contributions, insurance premiums, and so on But
for this problem, well focus on just the federal tax.
Here are two examples of how the federal tax is computed.
Alice earns $ as a software engineer. Her income can be broken down into four
parts:
The first $ incurs of tax: $times $
The part between $ and $ incurs of tax: $ $times
$
The part between $ and $ incurs of tax: $ $times
$
Finally, the part over $ incurs of tax: $ $times $
Alices total tax owed is thus $ $ $ $ $ Her effective
tax rate is $$ or
Bob earns $ as a sloth trainer. His income can be broken down into two parts:
The first $ incurs of tax: $times $
The part between $ and $ incurs of tax: $ $times
$
Bobs total tax owed is thus $ $ $ His effective tax rate is $$
or about
Your task in this problem is to write a program that computes the federal tax owed for any
salary. After youre done, maybe you can start your own company to compete with H&R Block!
b points Write a program named tax calculator.py that reads user input for
income earned and computes the tax owed and effective tax rate. Assume the user enters
a valid income. The program also provides a bracketbybracket breakdown of how the tax
owed was computed. Round off all monetary amounts to two decimal places, and round
off the effective tax rate to one decimal place. Verify that your program works correctly
using the earlier examples, as well as your own test cases.
Page of
Example program run underlined parts indicate what the user enters
What was your income?
First $ : $
$ $ : $
$ $ : $
$ $: $
Total tax owed: $
Effective tax rate:
Make sure code is run in python and do not use the break command and please use conditionals!!
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