1. You should have posted in the Java Forum for experienced Java users to see this post
2. Why make a duplicate thread about the same problem with your last thread?
3. Are the suggestions in the other thread not helpful?
zeroliken
Nearly a Posting Virtuoso
1,346 posts since Nov 2011
Reputation Points: 214
Solved Threads: 205
Skill Endorsements: 14
well AFAIK even if you convert the values to double You can't store them in an int variable
my counter is causing the problem
which variable are you talking about?
zeroliken
Nearly a Posting Virtuoso
1,346 posts since Nov 2011
Reputation Points: 214
Solved Threads: 205
Skill Endorsements: 14
System.out.printf("\n%s\t%11s\n\n","REP","SALARY")
System.out.printf("\n\n\n%s\t%10\n\n","BONUS","TOTAL");
These are wrong, the arguments used here are not variables
1.Initialize the variables bonus and total array as double(no need to change variable counter as a double)
2. use %f at the printf statements for the variables which are double
3. use these for precision
bonus = (double) wages[counter]/100*30;
total[counter] = (double) wages[counter]+bonus
4. use code tags next time
zeroliken
Nearly a Posting Virtuoso
1,346 posts since Nov 2011
Reputation Points: 214
Solved Threads: 205
Skill Endorsements: 14
Question Answered as of 1 Year Ago by
zeroliken
and
skilly