1. Given income and federal tax brackets, calculate taxes, net and gross.
2019 Federal Tax Brackets
12%
$9,701 to $39,475
22%
$39,476 to $84,200
24%
$84,201 to $160,725
32%
$160,726 to $204,100
35%
$204,101 to $510,300
a) Create a variable for income and give it some value (i.e. $75,000)
b) Create a table of income ranges.
c) Create a table of tax percentages.
d) Using both tables and the income variable, compute the tax percentage.
e) Given the selected tax percentage, calculate the tax rate.
d) Use the string.format() method to print:
gross income, tax percentage, tax amount, net income
Gross income is the income before taxes.
Net income is the income after taxes.
e) Ensure that decimal places are only printed as needed (see examples).
Output Example 1
Gross:
$75000
Federal Tax Bracket:
0.22
Federal Taxes:
$16500
Net:
$58500
Output Example 2
Gross:
$95000
Federal Tax Bracket:
0.24
Federal Taxes:
$22800
Net:
$72200
ET-574 Programming and Applications with Python
S. Trowbridge 2020