i'm doing a payroll system and i have finished it but i need some eror checking reports for name and integer but i'm going to do the integer first which wll input hours of a day from monday to friday what i need is a loop along with error checking to make sure that the hours inputted doesnt go past 24hours
i started wirting a if statement but i dont know what the hell i am doing and i am runniong out of help and i dont even have internet at home any more so pls help me show me a error checking tutorial or something pls
int add_hours(float *hours)
{
int mo, tu, we, th, fr;
if(*hours<=24)
printf("Enter daily hours for Monday:\n");
scanf("%d",&mo);
else
printf("the code you have entered is invalid please neter a number less than 24 hours");
printf("Enter daily hours for Tuesday:\n");
scanf("%d",&tu);
printf("Enter daily hours for Wednesday:\n");
scanf("%d",&we);
printf("Enter daily hours for Thursday:\n");
scanf("%d",&th);
printf("Enter daily hours for Friday:\n");
scanf("%d",&fr);
*hours=mo+tu+we+th+fr;
printf("\nThe weekly hours are:%f\n",*hours);
printf("\t^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n");
printf("\t^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n");
}