. 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.
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.
Comment