//******************************************************* 
// 
// Homework: 2 
// 
// Name: Paul Randall 
// 
// Class: C Programming, Fall 2026
// 
// Date: 9/16/2026 
// 
// Description: Loop program to calculate gross pay of employees
//
// Non file pointer solution 
// 
//******************************************************** 
 
#include <stdio.h>

int main(void)
{
    int  employees;      /* number of data sets to process */
    int  i;              /* loop counter                   */
    int  clock_number;   /* employee clock number          */
    float wage;          /* hourly wage rate               */
    float hours;         /* hours worked this week         */
    float gross;         /* calculated gross pay           */

    /* Find out how many employees to process */
    printf("Enter the number of employees to process: ");
    scanf("%d", &employees);

    /* Process one employee per pass through the loop */
    for (i = 1; i <= employees; i = i + 1) {

        printf("\nEnter clock number for employee %d: ", i);
        scanf("%d", &clock_number);

        printf("Enter hourly wage for employee %d: ", i);
        scanf("%f", &wage);

        printf("Enter hours worked for employee %d: ", i);
        scanf("%f", &hours);

        gross = wage * hours;

        printf("\n");
        printf("Clock #    Wage    Hours    Gross\n");
        printf("-------  ------   ------  -------\n");
        printf("%06d    %5.2f    %5.1f  %7.2f\n",
               clock_number, wage, hours, gross);
    }

    return 0;
}