text: I have this assignment I need to do using an array. I get this error at the end of the line containing the array.
  Code java:
  I'm not sure why. Inserting a semi colon also gives an error. Any help would be nice. Thank you.
  Printable View
  I have this assignment I need to do using an array. I get this error at the end of the line containing the array.
  Code java:
  I'm not sure why. Inserting a semi colon also gives an error. Any help would be nice. Thank you.
  inc < TaxPayer;
  How large of an integer is TaxPayer
  In the future please copy-paste error messages, as the exact wording is very important. Not all errors are as sore thumb as this one.
  Probably because there is not one missing. Depends on where you put it.Probably because there is not one missing. Depends on where you put it.Quote:
  I'm not sure why. Inserting a semi colon also gives an error.
  I know I should've included the errors exactly as they were, but they were very confusing to me for some reason, I ended up changing my entire program around. I have two classes. Here's the entire program:
  Code java:
  public class TaxPayer { private long social; private double income; public TaxPayer() { social = 1; income = 0; } public long GetSocial() { return social; } public void SetSocial(long SSN) { social = SSN; } public double GetIncome() { return income; } public void SetIncome(double money) { income = money; } } public class UseTaxPayer { public static void main(String[] args) { TaxPayer First = new TaxPayer(); double income = First.GetIncome(); long SSN = First.GetSocial(); int[] TaxArray = new int[10]; double Total = income; for(int x = 0; x < TaxArray.length; x++) { System.out.println("SSN = " + SSN + " Income = $" + Total + "0"); SSN++; Total = (income + Total); } } }
  I now have a different problem. As my program runs the income is supposed to be raised by 10,000 each time, however the variable seems to remain the same each time. Any idea how I can fix this?
  I'm going to continue tinkering with it, but I do need the help. I'm also worried I may not be satisfying the entire assignment, but I'll cross the bridge once I get this working, cause it's the closest I've gotten all week. I know this should be easy as pie, but I'm really struggling with the class for some reason...Apparently Trig and Java just aren't my things, and the one assignment a week isn't really enough practice, well one assignment plus tutorial assignments which are really just copy out of the book and into the computer but I'm trying to comprehend it all. Thank you for your help again.
  Edit:
  Right I fixed my incrementing problem, it should've read Total = (income + Total); vice Total = (income + 10000); it now increments properly. Now onto the question of whether I've done what is asked in the assignment. Because the way I read it, it makes no sense, but perhaps I'm incorrect in that assumption.
  The Assignment reads as follows
  [highlight = java]
  int[] TaxPayers = {1, 2, 3, 4, 5, 6, 7, 8, 9, 10}:
  int[] Income = {10000, 20000, 30000, 40000, 50000, 60000, 70000, 80000, 90000, 10000};
  [/highlight]?