Hi,

I need your help and advise. Something is very wrong with my code, but I am not able to figure out all day long, I am totaly confused between my 1D arrays and functions, what needs to be "return ( )". Thanks!

Code:#include <stdio.h> #include <stdlib.h> long id_number[5]={5466,5546,4432,3345,2345}; float hours[5]; float overtime[5]; float gross[5]; float deduction[5]; float net_pay[5]; float wage[5] = {10.60, 9.75, 10.50,12.25, 8.35}; float get_hours (float wage[]) { int temp, i = temp; for (temp=1; temp<6; ++temp) { printf ("Enter employee #%d hours worked: ",id_number[temp-1]); scanf ("%f", &hours[temp-1]); } return 0; } float calculate_overtime (float wage[]) { int temp, i = temp ; float overtime; for (temp=1; temp<6; ++temp) { if (hours[temp-1] > 40) overtime = hours[temp-1]- 40; else overtime = 0; } return (overtime); } float calculate_gross (float wage[]) { int temp, i = temp; for (temp=1; temp<6; ++temp) { if (overtime[temp-1] > 0) gross[temp-1] = (wage[temp-1]* 40) + ((wage[temp-1] * 1.5) * overtime[temp-1]); else gross[temp-1] = (wage[temp-1] * hours[temp-1]) + ((wage[temp-1] * 1.5) * overtime[temp-1]); } return (gross[temp -1]); } float calculate_deduction (float gross) { { int temp, i = temp; for (temp=1; temp<6; ++temp) deduction[temp-1]=gross[temp-1]/3; } return (deduction); } float calculate_net (float deduction) { int temp, i = temp; for (temp=1; temp<6; ++temp) net_pay[temp-1]=gross[temp-1]- deduction[temp-1]; } return (net_pay[temp-1]); } void output (void) { int temp; printf ("\n\n"); printf ("-----------------------------------------------------------------------\n"); printf ("EM# Pay Rate Hours OT Gross Pay Deduction Net Pay\n"); printf ("-----------------------------------------------------------------------\n"); for (temp=1; temp<6; ++temp) { printf ("%d $%5.2f %5.1f %5.1f $%6.2f\n", id_number[temp-1], wage[temp-1], hours[temp-1], overtime[temp-1], gross[temp-1]),deduction[temp-1], net_pay [temp-1]; } } int main () { /*Execute functions*/ get_hours (hours); calculate_overtime (overtime); calculate_gross (gross); calculate_deduction (deduction); calculate_net (net_pay); output (); printf ("\n"); /*Keep window open*/ system("PAUSE"); }