#include <stdio.h>

#define SIZE 5
#define STD_HOURS 40.0
#define OT_RATE 1.5

int main(void)
{
    int clock[SIZE];
    double wage[SIZE];
    double hours[SIZE];
    double overtimeHours[SIZE];
    double grossPay[SIZE];

    double normalPay;
    double overtimePay;

    int i;

    /* Input employee information */
    for (i = 0; i < SIZE; ++i)
    {
        printf("Enter Clock#, Wage, and Hours for employee %d: ", i + 1);
        scanf("%d %lf %lf", &clock[i], &wage[i], &hours[i]);

        /* Calculate overtime hours */
        if (hours[i] > STD_HOURS)
            overtimeHours[i] = hours[i] - STD_HOURS;
        else
            overtimeHours[i] = 0.0;

        /* Calculate normal pay */
        if (hours[i] > STD_HOURS)
            normalPay = STD_HOURS * wage[i];
        else
            normalPay = hours[i] * wage[i];

        /* Calculate overtime pay */
        overtimePay = overtimeHours[i] * wage[i] * OT_RATE;

        /* Calculate gross pay */
        grossPay[i] = normalPay + overtimePay;
    }

    /* Print results */
    printf("\n");
    printf("------------------------------------------------\n");
    printf("Clock#   Wage   Hours    OT     Gross\n");
    printf("------------------------------------------------\n");

    for (i = 0; i < SIZE; ++i)
    {
        printf("%06d %6.2f %6.1f %6.1f %8.2f\n",
               clock[i],
               wage[i],
               hours[i],
               overtimeHours[i],
               grossPay[i]);
    }

    printf("------------------------------------------------\n");

    return 0;
}