Results 1 to 12 of 12
- 10-14-2010, 05:08 AM #1
Member
- Join Date
- Oct 2010
- Posts
- 81
- Rep Power
- 0
Java IRS Programming Help. Please Save me!
I need help with this program ! :( i dont have a good ideaa on how to do this
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 __________
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
-
Hello, and welcome to the forum.
So in essence what you've done is to give us your entire assignment without asking a question and without showing any evidence of effort on your part, and I'm afraid that in this situation there's not much that we can do for you other than to direct you to a tutorial or two.
I suggest that you post your best solution that you've created so far, and ask as specific questions as possible, and we'll be much better able to help. If you really have no idea how to begin here, then please have a look here: Starting Writing a Program. It's a well-written article that can help.
Much luck
-
Again, please respond: what part of this assignment are you not sure of? What have you tried? What isn't working? If you can ask specific questions, we can give you specific answers.
- 10-14-2010, 05:39 AM #4
Member
- Join Date
- Oct 2010
- Posts
- 81
- Rep Power
- 0
i was wondering on how to start the code. i think to my knowledge that you have to import a scanner to get it to command what it is asking for such as the maritial status and federal tax
-
Yes, a Scanner object can be created and used to obtain input from the user. You'd prompt the user with a System.out.print("...") call, and then obtain their input with your Scanner object, and then use that input to calculate the tax. Have you done the first part of the assignment: calculate the tax on paper for examples a. through j. before trying to code it in Java?
- 10-14-2010, 05:48 AM #6
Member
- Join Date
- Oct 2010
- Posts
- 81
- Rep Power
- 0
so to find out the mariatal status
I would do
System.out.println("Enter Martial Status");
? Like that but then it says to enter 1 or 2 to get married or single i dont know how to do that
-
I would simply take the string as it was written word-for-word up to the spot where the user enters his input and stuff it into a print method:
There's no magic here -- it's simply the String that the teacher gave you in the assignment.Java Code:System.out.print("Enter marital status (1=single, 2=married): ");
I prefer print over println here since it forces the user to answer on the same line that the prompt is on.
- 10-14-2010, 05:59 AM #8
Member
- Join Date
- Oct 2010
- Posts
- 81
- Rep Power
- 0
so far i only have this. can you tell me if this is goiung to be a long program
import java.util.Scanner;
public class Taxes {
public static void main(String[] args) {
System.out.print("Enter marital status (1=single, 2=married) ");
-
- 10-14-2010, 06:02 AM #10
Member
- Join Date
- Oct 2010
- Posts
- 81
- Rep Power
- 0
yes i do understand the math. for that i would use if statements? is that part of the code correct? or no
-
If statements could work there, yes.
Quite frankly, you've got some work ahead of you to do, and if you seek confirmation for each step of your program before you code it, it's going to be a long hard ride. Instead, you may want to leave the forum and instead just try to write your program. Then please feel free to come on back if you get stuck in a spot or if the code fails to work as you expect it to.
- 10-14-2010, 06:17 AM #12
Member
- Join Date
- Oct 2010
- Posts
- 81
- Rep Power
- 0
Similar Threads
-
How can i save the data Internally(auto save)
By Rama Koti Reddy in forum AWT / SwingReplies: 2Last Post: 11-01-2010, 08:31 PM -
Java JTextPane Save
By ikurtz in forum AWT / SwingReplies: 2Last Post: 04-27-2010, 10:47 PM -
Java applet+save to file
By mattu36 in forum Java AppletsReplies: 12Last Post: 06-24-2009, 04:41 AM -
E:\IT 215 Java Programming\Inventory.java:36: class, interface, or enum expected
By tlouvierre in forum Advanced JavaReplies: 16Last Post: 05-28-2009, 03:41 PM -
save text into xml in java
By Omarero in forum New To JavaReplies: 8Last Post: 10-26-2008, 02:19 AM


LinkBack URL
About LinkBacks
Reply With Quote

Bookmarks