Code:
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#define FEDTAXRATE 0.15
#define STATETAXRATE 0.07
#define SSITAXRATE 0.0775
#define OVERTIME 40
#define FORMAT1 " %-25s %5.2f %7.2f %7.2f %7.2f %6.2f %7.2f\n"
#define FORMAT2 " %7.2f %7.2f %6.2f\n\n"
#define MAX_EMPLOYEE 5
typedef struct EmployeeRecord
{
char lastname[20+1];
char firstname[20+1];
float payrate;
float hours;
float defr;
float net;
float reg_hours;
float ovt_hours;
float gross;
float ft, st, ssit;
} EmployeeRecord;
void PrintReportHeadings(FILE * report); //3.1
void InitializeAccumulators(float *tot_payrate,
float *tot_reghours,
float *tot_ovthours,
float *tot_gross,
float *tot_fed,
float *tot_state,
float *tot_SSI,
float *tot_defr,
float *tot_net); //3.2
void InputWorkerData(char *lastname,
char *firstname,
float *hours,
float *payrate,
float *defr); //3.3
float CalcGross (float hours,
float payrate); //3.4
void CalcTaxes(float gross,
float defr,
float *fedtax,
float *statetax,
float ........itax); //3.5
float CalcFedTax(float gross,
float deferred); //3.5.1
float Calcstatetax(float fedtax); //3.5.2
float CalcSSITax(float gross,
float deferred); //3.5.3
void AddDetailToAccumulators(float *tot_payrate,
float *tot_reghours,
float *tot_ovthours,
float *tot_gross,
float *tot_fed,
float *tot_state,
float *tot_SSI,
float *tot_defr,
float *tot_net,
float *fedtax,
float *statetax,
float ........it,
float gross,
float reg_hours,
float ovt_hours,
float payrate,
float defr); //3.6
extern float CalcNetPay(float gross,
float *fedtax,
float *statetax,
float ........itax,
float defr); //3.7
void CalcAverages(float *tot_payrate,
float *tot_reghours,
float *tot_ovthours,
float *tot_gross,
float *tot_fed,
float *tot_state,
float *tot_SSI,
float *tot_defr,
float *tot_net,
FILE * report); //3.8
void PrintTotAvg(float *tot_payrate,
float *tot_reghours,
float *tot_ovthours,
float *tot_gross,
float *tot_fed,
float *tot_state,
float *tot_SSI,
float *tot_defr,
float *tot_net,
float avg_payrate,
float avg_reghours,
float avg_ovthours,
float avg_gross,
float avg_fed,
float avg_state,
float avg_SSI,
float avg_defr,
float avg_net,
FILE * report); //3.9
void CalcHours(float *hours,
float *reg_hours,
float *ovt_hours); // 3.10
void PrintEmployeeData(EmployeeRecord employees[],
int count_emp,
FILE * report); //3.11
extern void BubbleSort(EmployeeRecord employees[], int max_employee); //3.12