Results 1 to 12 of 12
  1. #1
    socboy6579 is offline Member
    Join Date
    Oct 2010
    Posts
    81
    Rep Power
    0

    Default 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

  2. #2
    Fubarable's Avatar
    Fubarable is offline Moderator
    Join Date
    Jun 2008
    Posts
    19,316
    Blog Entries
    1
    Rep Power
    26

    Default

    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

  3. #3
    Fubarable's Avatar
    Fubarable is offline Moderator
    Join Date
    Jun 2008
    Posts
    19,316
    Blog Entries
    1
    Rep Power
    26

    Default

    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.

  4. #4
    socboy6579 is offline Member
    Join Date
    Oct 2010
    Posts
    81
    Rep Power
    0

    Default

    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

  5. #5
    Fubarable's Avatar
    Fubarable is offline Moderator
    Join Date
    Jun 2008
    Posts
    19,316
    Blog Entries
    1
    Rep Power
    26

    Default

    Quote Originally Posted by socboy6579 View Post
    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?

  6. #6
    socboy6579 is offline Member
    Join Date
    Oct 2010
    Posts
    81
    Rep Power
    0

    Default

    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

  7. #7
    Fubarable's Avatar
    Fubarable is offline Moderator
    Join Date
    Jun 2008
    Posts
    19,316
    Blog Entries
    1
    Rep Power
    26

    Default

    Quote Originally Posted by socboy6579 View Post
    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:

    Java Code:
    System.out.print("Enter marital status (1=single, 2=married): ");
    There's no magic here -- it's simply the String that the teacher gave you in the assignment.

    I prefer print over println here since it forces the user to answer on the same line that the prompt is on.

  8. #8
    socboy6579 is offline Member
    Join Date
    Oct 2010
    Posts
    81
    Rep Power
    0

    Default

    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) ");

  9. #9
    Fubarable's Avatar
    Fubarable is offline Moderator
    Join Date
    Jun 2008
    Posts
    19,316
    Blog Entries
    1
    Rep Power
    26

    Default

    Quote Originally Posted by socboy6579 View Post
    so far i only have this. can you tell me if this is goiung to be a long program
    Sorry but your question makes no sense. What does it matter how long it is as long as it solves the problem? Also, uou still haven't answered my question: have you solved the first part of your assignment? Do you understand the math required to do the coding?

  10. #10
    socboy6579 is offline Member
    Join Date
    Oct 2010
    Posts
    81
    Rep Power
    0

    Default

    yes i do understand the math. for that i would use if statements? is that part of the code correct? or no

  11. #11
    Fubarable's Avatar
    Fubarable is offline Moderator
    Join Date
    Jun 2008
    Posts
    19,316
    Blog Entries
    1
    Rep Power
    26

    Default

    Quote Originally Posted by socboy6579 View Post
    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.

  12. #12
    socboy6579 is offline Member
    Join Date
    Oct 2010
    Posts
    81
    Rep Power
    0

    Default

    i just have one more question. When it says enter marital status how do i make the program recognize that the 1 means single and the 2 means married

Similar Threads

  1. How can i save the data Internally(auto save)
    By Rama Koti Reddy in forum AWT / Swing
    Replies: 2
    Last Post: 11-01-2010, 09:31 PM
  2. Java JTextPane Save
    By ikurtz in forum AWT / Swing
    Replies: 2
    Last Post: 04-27-2010, 11:47 PM
  3. Java applet+save to file
    By mattu36 in forum Java Applets
    Replies: 12
    Last Post: 06-24-2009, 05:41 AM
  4. Replies: 16
    Last Post: 05-28-2009, 04:41 PM
  5. save text into xml in java
    By Omarero in forum New To Java
    Replies: 8
    Last Post: 10-26-2008, 03:19 AM

Tags for this Thread

Posting Permissions

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