1
Student Name: __________________
Class and Section __________________
Total Points (20 pts) __________________
Due: Feb 11, 2011 before the class
Project: Computing Tax
CSCI 1301 Introduction to Programming Principles
Armstrong Atlantic State University
Problem Description:
Table 1
2009 U.S. Federal Personal Tax Rates
Marginal
Tax Rate
Single
Married Filing Jointly
or Qualified 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
25%
$33,951 $82,250
$67,901 $137,050
$33,951 $68,525
$45,501 $117,450
28%
$82,251 $171,550
$137,051 $208,850
$68,525 $104,425
$117,451 $190,200
33%
$171,551 $372,950
$208,851 $372,950
$104,426 $186,475
$190,201 – $372,950
35%
$372,951+
$372,951+
$186,476+
$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 compute the tax. Enter 0
for single filers, 1 for married filing jointly, 2 for married filing separately, and 3 for head
of household.
Here are sample runs of the program:
Sample 1:
Enter the filing status: 0
Enter the taxable income: 100000
Tax is 21720.0
Tax is 29665.5
Sample 4:
Enter the filing status: 3
Enter the taxable income: 4545402
Tax is 1565250.7
Analysis:
(Describe the problem including input and output in your own words.)
Design:
(Describe the major steps for solving the problem.)
3
Submit the following items:
1. Print this Word file and Submit to me before the class on the due day
2. Compile, Run, and Submit to LiveLab (you must submit the program regardless
whether it is complete or incomplete, correct or incorrect)
4
Code Solution:
public class Test {
public static void main(String[] args) {
java.util.Scanner input = new java.util.Scanner(System.in);
// Prompt the user to enter filing status
System.out.print(
}
else if (status == 1) { // Compute tax for married file jointly
if (income <= 16700) {
tax = income * 0.10;
}
else if (income <= 67900) {
tax = 16700 * 0.10 + (income 16700) * 0.15;
}
else if (income <= 137050) {
tax = 16700 * 0.10 + (67900 16700) * 0.15 +
(income 67900) * 0.25;
}
else if (income <= 171950) {
5
}
}
else if (status == 3) { // Compute tax for head of household
if (income <= 11950) {
tax = income * 0.10;
6