1. The United States Federal personal income tax is calculated based on filing status and taxable income....
Question:
1. The United States Federal personal income tax is calculated based on filing status and taxable income. There are four filing statuses: single filers (0) , married filing jointly or qualified widow(er) (1), married filing separately (2), and head of household(3). The tax rates vary every year. The table shows the rates for 2009.
Calculation for single with a taxable income of $10,000
In this case, the first $8350 is taxed at 10%, and the other $1650 ($10,000- $8350) is taxed at 15%.
tax = $8350 * 0.10 + (10000 - 8350) * 0.15 = $835 + $247.50 = $1082.50
Table - US Federal Personal Tax Rates for 2009
Marginal Tax Rate | Single | Married Filing Jointly or Qualifying Widow(er) | Married Filing separately | Head of Household |
10% | $0 -$8,350 | $0 - $16,700 | $0 -$8,350 | $0 - $11,950 |
15% | $8,351 - $33,950 | $16,701 - $67,900 | $8,351 - $33,950 | $11,951 - $45,500 |
The status are given these numbers
0 - single filers
1 - married filing jointly or qualified widow(er)
2 - married filing separately
3 - head of household.
Write a C++ program for computing the tax using main and the computeTax function with the following header:
double computeTax(int status, double taxableIncome)
This is a value returning function that takes in the status, an integer and taxable income, a double and returns a double.
Use this function to write a program that prints a tax table for taxable income from $20,000 to $30,000 with intervals of $50 for all four statuses. Use a for loop in main and call the computeTax function with appropriate status and income. Save the file as Finals2.cpp