Question: (a) Write a Java program for computing income taxes for all four cases. Test your program for an income of $ 79,000 per year. Listing


(a) Write a Java program for computing income taxes for all four cases. Test your program for an income of $ 79,000 per year. Listing 3.5 provides code for one case. Extend this code for all cases. (b) Re-write this code using switch statement. Use of break statement is suggested. TABLE 3.2 2009 U.S. Federal Personal Tax Rates Marginal Married Filing Jointly or Tax Rate Single Qualifying Widow(er) Married Filing Separately Head of Household 10% $0-$16,700 15% 25% $0-$8,350 $8,351-$33,950 $33,951-$82,250 $82.251-$171,550 $171,551-$372,950 $0-$8,350 $8,351-$33,950 $33,951-$68,525 $68,526-$104,425 $104,426-$186,475 $16,701-$67,900 $67,901-$137,050 $137,051-$208,850 $208,851-$372,950 $372,951+ $0-$11,950 $11,951-$45,500 $45,501-$117,450 $117,451-$190,200 $190,201-$372,950 $372,951+ 28% 33% 35% $372,951+ $186,476+ (a) Write a Java program for computing income taxes for all four cases. Test your program for an income of $ 79,000 per year. Listing 3.5 provides code for one case. Extend this code for all cases. (b) Re-write this code using switch statement. Use of break statement is suggested. TABLE 3.2 2009 U.S. Federal Personal Tax Rates Marginal Married Filing Jointly or Tax Rate Single Qualifying Widow(er) Married Filing Separately Head of Household 10% $0-$16,700 15% 25% $0-$8,350 $8,351-$33,950 $33,951-$82,250 $82.251-$171,550 $171,551-$372,950 $0-$8,350 $8,351-$33,950 $33,951-$68,525 $68,526-$104,425 $104,426-$186,475 $16,701-$67,900 $67,901-$137,050 $137,051-$208,850 $208,851-$372,950 $372,951+ $0-$11,950 $11,951-$45,500 $45,501-$117,450 $117,451-$190,200 $190,201-$372,950 $372,951+ 28% 33% 35% $372,951+ $186,476+
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
