//*******************************************************
//
// Homework: 2
//
// Name: Joe Student
//
// Class: C Programming, Summer 2026
//
// Date: June 1, 2026
//
// Description: Program which determines gross pay and outputs
// to the screen using a loop.   This version does not use file 
// pointers
//
// Non file pointer solution
//
//********************************************************

#include <stdio.h>
int main ()
{

	int clockNumber; // employee clock number
	float gross;     // gross pay for week (wage * hours)
	float hours;     // number of hours worked per week
	float wageRate;  // hourly wage

	int i;           // loop index
	int empNum;      // number of employees to process

    // prompt for number of employees to process
	printf ("Enter number of employee: ");
	scanf  ("%i", &empNum);
	
	printf ("\n\t*** Pay Calculator ***\n");

    // process each employee
	for (i = 0; i <= empNum; ++i)
	{
		// Prompt for input values from the screen
		printf ("\n\tEnter clock number for employee: ");
		scanf ("%d", &clockNumber);
		printf ("\n\tEnter hourly wage for employee: ");
		scanf ("%f", &wageRate);
		printf ("\n\tEnter the number of hours the employee worked: ");
		scanf ("%f", &hours);

		// calculate gross pay
		gross = wageRate * hours;

		// print out employee information
		printf ("\n\n\t----------------------------------------------------------\n");
		printf ("\tClock # Wage Hours Gross\n");
		printf ("\t----------------------------------------------------------\n");

		printf ("\t%06i %5.2f %5.1f %7.2f\n", clockNumber, wageRate, hours, gross);

	} // for

	return (0); // success

} // main

