#include <stdio.h>

#define NUM_EMPLOYEES 5     // Number of employees to process
#define STD_HOURS 40.0         // Threshold for overtime hours
#define OVERTIME_RATE 1.5    // Overtime pay is 1.5 times the regular rate

int main() {
    
    int clockNumber; // Employee clock number
    float wageRate;   // Hourly wage for an employee
     float hoursWorked; // Total hours worked in a week
     float overtimeHours; // overtime hours worked  
     float grossPay;       // The weekly gross pay which is the normalypay +overtimePay

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

    // Process each employee in 
    for (int i = 0; i < NUM_EMPLOYEES; i++) {
        // Prompt the user for the clock number 
        printf("\nEnter clock number for employee %d: ", i + 1);
        scanf("%d", &clockNumber);
		//Prompt the user for the wage rate
        printf("Enter wage rate for employee %d: ", i + 1);
        scanf("%f", &wageRate);
		//Prompt the user for the number of  hours worked
        printf("Enter hours worked for employee %d: ", i + 1);
        scanf("%f", &hoursWorked);

        // Calculate overtime hours (anything over 40 hours)
        if (hoursWorked > STD_HOURS) {
            overtimeHours = hoursWorked -STD_HOURS ;
        } else {
            overtimeHours = 0.0;
        }

        // Calculate gross pay
        if (overtimeHours > 0) {
            grossPay = (STD_HOURS * wageRate) + (overtimeHours * wageRate * OVERTIME_RATE);
        } else {
            grossPay = hoursWorked * wageRate;
        }

        // Output employee data with formatted values
        printf("%06d  %.2f  %.1f  %.1f  %.2f\n", clockNumber, wageRate, hoursWorked, overtimeHours, grossPay);
    }

    return 0;
}