Project: Income Tax (Single Taxpayer)
US Income Tax is calculated based on brackets. Write a program that uses the tables below to calculate the 2020 income tax for single taxpayers. The program should accept one command line argument, the taxable income amount. Use IF/ELSE statements to do the tax computation.
Rate | Taxable Income Bracket | Tax Owed |
---|---|---|
10% |
$0 to $9,875 | 10% of Taxable Income |
12% |
$9,876 to $40,125 | Maximum tax from previous bracket plus 12% of the excess over $9,875 |
22% |
$40,126 to $85,525 | Maximum tax from previous bracket plus 22% of the excess over $40,125 |
24% |
$85,526 to $163,300 | Maximum tax from previous bracket plus 24% of the excess over $85,525 |
32% |
$163,301 to $207,350 | Maximum tax from previous bracket plus 32% of the excess over $163,300 |
35% |
$207,351 to $518,400 | Maximum tax from previous bracket plus 35% of the excess over $207,350 |
37% |
$518,401+ | Maximum tax from previous bracket plus 37% of the excess over $518,400 |
Source: [[Federal Income Tax Brackets]]
Output
$ swiftc IncomeTax1.swift -I . -L . -lUtils
error: link command failed with exit code 1 (use -v to see invocation)
ld: library not found for -lUtils
clang: error: linker command failed with exit code 1 (use -v to see invocation)
$ swiftc IncomeTax1.swift -I . -L . -lUtils
error: link command failed with exit code 1 (use -v to see invocation)
ld: library not found for -lUtils
clang: error: linker command failed with exit code 1 (use -v to see invocation)
$ swiftc IncomeTax1.swift -I . -L . -lUtils
error: link command failed with exit code 1 (use -v to see invocation)
ld: library not found for -lUtils
clang: error: linker command failed with exit code 1 (use -v to see invocation)
$ swiftc IncomeTax1.swift -I . -L . -lUtils
error: link command failed with exit code 1 (use -v to see invocation)
ld: library not found for -lUtils
clang: error: linker command failed with exit code 1 (use -v to see invocation)