Ok. here is the problem.
My program works perfectly fine when the over time is >0 when calculateing gross pay.. But when the ot rate is zero i get some garbage number in my array position for gross pay...
This is the part of my program that does the gross pay/ot .
/* Check for overtime */
if (hours_array[i] > 40)
othours_array[i] = hours_array[i] - 40;
otpay_array[i] = othours_array[i] * (wages_array[i] * 1.5f);
else othours_array[i] = 0;
/* Calculate gross pay */
gross_array[i] = wages_array[i] * (hours_array[i] - othours_array[i]) + otpay_array[i];
if my calculate gross pay formula off for some reason when ot end up zero? or is it some mechanical issue in arrays? Any help you can provide would be appreciated. If you need more info please let me know