Just glancing at it, when you convert to int seems to be the issue.
int salaryIndex = (int)(salary / 100 - 2);\
I think you probably want
int salaryIndex = ((int)salary/100) - 2;
There are a few unnecessary brackets in what I wrote -- but they never hurt.
You will still have an issue with producing -1 and -2 as an index for the lower salaries though and will have to fix the index for these cases in some manner.
perhaps something like?
int salaryIndex = ((int)salary/100) - 2;
if (salaryIndex < 0) salaryIndex = 0;
but I'm not going to read all of it
What I've mentioned won't fix the print stuff
