The United States federal personal income tax is calculated based on filing status and taxable income. There are four filing statuses: single filers, married filing jointly, married filing separately, and head of household. The tax rates vary every year. Table 4.2 shows the rates for 2009. If you are, say, single with a taxable income of $10,000, the first $8,350 is taxed at 10% and the other $1,650 is taxed at 15%. So, your tax is $1,082.50. TABLE 4.2 2009 U.S. Federal Personal Tax Rates Marginal Tax Rate 10% 15% 25% 28% 33% 35% Single $0-$8,350 $8,351-$33,950 $33,951-$82,250 $82,251-$171,550 $171,551-$372,950 $372,951+ Married Filing Jointly $0-$16,700 $16,701-$67,900 $67,901-$137,050 $137,051-$208,850 $208,851-$372,950 $372,951+ Married Filing Separately $0-$8.350 $8,351-$33,950 $33,951 - $68,525 $68,526-$104,425 $104,426-$186,475 $186,476+ Head of Household $0-$11.950 $11,951-$45,500 $45,501-$117,450 $117,451-$190,200 $190,201-$372,950 $372,951+ You are to write a program to compute personal income tax. Your program should prompt the user to enter the filing status and taxable income and then compute the tax. Enter 0 for single filers, 1 for married filing jointly, 2 for married filing separately, and 3 for head of household. Your program computes the tax for the taxable income based on the filing status.
Control structures
Control structures are block of statements that analyze the value of variables and determine the flow of execution based on those values. When a program is running, the CPU executes the code line by line. After sometime, the program reaches the point where it has to make a decision on whether it has to go to another part of the code or repeat execution of certain part of the code. These results affect the flow of the program's code and these are called control structures.
Switch Statement
The switch statement is a key feature that is used by the programmers a lot in the world of programming and coding, as well as in information technology in general. The switch statement is a selection control mechanism that allows the variable value to change the order of the individual statements in the software execution via search.


Trending now
This is a popular solution!
Step by step
Solved in 3 steps with 1 images









