please help! JAVA question

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • alternative49e
    New Member
    • Nov 2007
    • 5

    #1

    please help! JAVA question

    . I need to modify the UseTaxpayer application so each Taxpayer has a successive Social Security number from 1 top 10 and a gross income that ranges from $10,000 to $100,000, increasing by $10,000 for each successive Taxpayer. Save as UseTaxpayer2

    Here is what I have so for far from the UseTaxpayer application. Any suggestions on how to get it to increment?


    Code: ( text )
    public class Taxpayer
    {
    private int socNum;
    private int yearIncome;

    public Taxpayer(int s, int i)
    {
    socNum = s;
    yearIncome = i;
    }
    public int getSocNum()
    {
    return socNum;
    }
    public int getYearIncome()
    {
    return yearIncome;
    }

    }


    and


    Code: ( text )
    public class UseTaxpayer
    {
    public static void main(String[] args)
    {
    Taxpayer[] aTaxpayer = new Taxpayer[10];

    for(int i = 0; i < 10; i++)
    aTaxpayer[i] = new Taxpayer(999999 999,0);
    for(int i = 0 ; i < 10; i++)
    {
    System.out.prin tln(aTaxpayer[i].getSocNum()
    + " " + aTaxpayer[i].getYearIncome( ));

    }
    }
    }


    Please do not double post. Post any replies here
    Locking this thread.
  • JosAH
    Recognized Expert MVP
    • Mar 2007
    • 11453

    #2
    Originally posted by alternative49e
    . I need to modify the UseTaxpayer application so each Taxpayer has a successive Social Security number from 1 top 10 and a gross income that ranges from $10,000 to $100,000, increasing by $10,000 for each successive Taxpayer. Save as UseTaxpayer2
    This is more like a linear algebra question 101: for a social security number s in
    the range [1,10] the taxpayer earns s*10000 dollars. (I don't save this to a file).

    kind regards,

    Jos

    Comment

    Working...