Pure Programmer

## 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.

Table 1. Single Taxable Income Tax Brackets and Rates, 2020
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
\$ g++ -std=c++17 IncomeTax1.cpp -o IncomeTax1 -lfmt \$ ./IncomeTax1 50000 Federal Income Tax: \$6790.00 \$ g++ -std=c++17 IncomeTax1.cpp -o IncomeTax1 -lfmt \$ ./IncomeTax1 100000 Federal Income Tax: \$18079.50 \$ g++ -std=c++17 IncomeTax1.cpp -o IncomeTax1 -lfmt \$ ./IncomeTax1 200000 Federal Income Tax: \$45015.50 \$ g++ -std=c++17 IncomeTax1.cpp -o IncomeTax1 -lfmt \$ ./IncomeTax1 1000000 Federal Income Tax: \$334427.00

Solution