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?
and
Here is what I have so for far from the UseTaxpayer application. Any suggestions on how to get it to increment?
Code:
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; } }
Code:
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(999999999,0); for(int i = 0 ; i < 10; i++) { System.out.println(aTaxpayer[i].getSocNum() + " " + aTaxpayer[i].getYearIncome()); } } }
Comment