# Thread: Probably Wrong Section But need to do IRS program in Java (Blue J)

1. Member
Join Date
Nov 2012
Posts
11
Rep Power
0

## Probably Wrong Section But need to do IRS program in Java (Blue J)

Hi there I have to do a java program that requires making an example as if ur filling out an IRS form... I have the assignment and will copy and paste it. Any help would be appreciated. As im not that very good with this stuff ;P since it only is my 2nd week in this course....

To summarize it.
If you can write the functioning code for it as if you were actually writing it yourself and using it... that would really be helpful... and thank u so much for ur time

Background:
Federal income tax rates can be calculated using tax rate schedules. The following are tax rates for two out of the four categories used by the IRS in 2001:
Schedule X - Single
If your taxable income is:
over - but not over - your tax is of the amount over -
\$ 0 \$ 27,050 15 % \$ 0
27,050 65,550 \$ 4,057.50 + 27.5 % 27,050
65,550 136,750 \$ 14,645.00 + 30.5 % 65,550
136,750 297,350 \$ 36,361.00 + 35.5 % 136,750
297,350 --------- \$ 93,374.00 + 39.1 % 297,350
Schedule Y-1 - Married filing jointly
If your taxable income is:
over - but not over - your tax is of the amount over -
\$ 0 \$ 45,200 15 % \$ 0
45,200 109,250 \$ 6,780.00 + 27.5 % 45,200
109,250 166,500 \$ 24,393.75 + 30.5 % 109,250
166,500 297,350 \$ 41,855.00 + 35.5 % 166,500
297,350 --------- \$ 88,306.00 + 39.1 % 297,350
To test your understanding, follow this example of a single person with taxable income of \$68,000:
Tax is \$14,645.00 + 0.305*(68000-65550) = \$14,645.00 + \$747.25 = \$15,392.25
Assignment:
1. One of the biggest mistakes that beginning programmers tend to make is to attempt solving the problem within their code before they really understand how to work the problem. Use the following values and solve each of them before you begin to write your program out.
a. \$50,000 Married __________
b. \$25,000 Single __________
c. \$300,000 Married __________
d. \$170,000 Single __________
e. \$30,000 Married __________
f. \$500,000 Single __________
g. \$170,000 Married __________
Programming Assignment: IRS
h. \$45,000 Single __________
i. \$130,000 Married __________
j. \$120,000 Single __________
2. Write a class that:
a. Prompts the user for the following information:
Filing status: Single or Married (entered as 1 for Single and 2 for Married)
Taxable income
b. Calculates and prints:
Filing status
Taxable income
Federal tax
3. Example run:
Enter marital status (1=single, 2=married): 1
Enter taxable income: \$ 35125
Your Federal tax = \$ 6,278.13
4. Use these values for your run output:
Single, \$15,500
Single, \$100,000
Single, \$ 480,000
Married, \$50,000
Married, \$125,000
Married, \$ 400,000

2. ## Re: Probably Wrong Section But need to do IRS program in Java (Blue J)

Which part of this are you stuck on? What have you tried?

3. Member
Join Date
Nov 2012
Posts
11
Rep Power
0

## Re: Probably Wrong Section But need to do IRS program in Java (Blue J)

I just dont understand the concept of taxes... or know how to exactly make a program that calculates taxes... I made one earlier for my first time. and tried doing the same type of methods i did.. but with different information.. and it doesnt work....

here it is... I believe it was unfinished.. but maybe this could shine some light, and maybe you can help me through this code.

import java.text.DecimalFormat;
public class Taxes
{
private final double Fed_Tax_Rate = 0.154;// Federal Tax Rate
private final double FICA_Tax_Rate = 0.0075;// FICA Tax Rate
private final double State_Tax_Rate = 0.04;// State Tax Rate

private double myHours;// Total hours worked
private double myRate;// Hourly Pay Rate
private double myGrossPay;// Total pay before taxes

public Taxes(double Hours, double Rate)// Calculate gross pay from total hours worked and hourly pay rate
{
myHours= Hours;
myRate= Rate;
myGrossPay = Rate * Hours;

}
public double getGrossPay()// Gets gross pay and doubles
{
return myGrossPay;
}
public double getHours()// Gets hours and doubles
{
return myHours;
}
public double getRate()// Gets hourly rate and doubles
{
return myRate;
}
private String customFormat(String pattern, double value)// Format and return the given numerical value in the manner requested
{
DecimalFormat myFormatter = new DecimalFormat(pattern);
return (myFormatter.format(value));
}
}

Does it have any correlation.. to the IRS program?

4. ## Re: Probably Wrong Section But need to do IRS program in Java (Blue J)

I'm not sure, you tell me. What does this program output? Does it output what you expect? Does it output what the IRS assignment is asking for?

5. Member
Join Date
Nov 2012
Posts
11
Rep Power
0

## Re: Probably Wrong Section But need to do IRS program in Java (Blue J)

I am going to be ashamed to say this.. but I dont even have the base code for the.. well IRS program.... thats why I figured maybe you can work with me and help get this thing solved?

7. ## Re: Probably Wrong Section But need to do IRS program in Java (Blue J)

We're much better at helping answer specific questions, questions that usually arise after you've tried some solution. It looks to me like this would be a good time to approach your teacher or instructor for assistance.

#### Posting Permissions

• You may not post new threads
• You may not post replies
• You may not post attachments
• You may not edit your posts
•