Why are you using count to control the number of times to loop?
You should use the number of elements in the array(numStaff) or the length of the array(payNum.length), not count = 10

Try to isolate the testing of findPayNum() from the other parts of the code. Just debug ONE thing at a time.
You need to pass good values to findPayNum and have it return a good index
and you need to pass bad values to findPayNum and have it return -1.
Save testing the other code until after findPayNum is working. Comment the other code out by putting it in /* ... */ so its not in the way.