Question: / / necessary header files #include #include #include / / for char functions #include / / for malloc / / define constants #define STD _

// necessary header files
#include
#include
#include // for char functions
#include // for malloc
// define constants
#define STD_HOURS 40.0
#define OT_RATE 1.5
#define MA_TAX_RATE 0.05
#define NH_TAX_RATE 0.0
#define VT_TAX_RATE 0.06
#define CA_TAX_RATE 0.07
#define DEFAULT_TAX_RATE 0.08
#define NAME_SIZE 20
#define TAX_STATE_SIZE 3
#define FED_TAX_RATE 0.25
#define FIRST_NAME_SIZE 10
#define LAST_NAME_SIZE 10
// Define a global structure type to store an employee name
//... note how one could easily extend this to other parts
// parts of a name: Middle, Nickname, Prefix, Suffix, etc.
struct name
{
char firstName[FIRST_NAME_SIZE];
char lastName [LAST_NAME_SIZE];
};
// Define a global structure type to pass employee data between functions
// Note that the structure type is global, but you don't want a variable
// of that type to be global. Best to declare a variable of that type
// in a function like main or another function and pass as needed.
// Note the "next" member has been added as a pointer to structure employee.
// This allows us to point to another data item of this same type,
// allowing us to set up and traverse through all the linked
// list nodes, with each node containing the employee information below.
struct employee
{
struct name empName;
char taxState [TAX_STATE_SIZE];
long int clockNumber;
float wageRate;
float hours;
float overtimeHrs;
float grossPay;
float stateTax;
float fedTax;
float netPay;
struct employee * next;
};
// this structure type defines the totals of all floating point items
// so they can be totaled and used also to calculate averages
struct totals
{
float total_wageRate;
float total_hours;
float total_overtimeHrs;
float total_grossPay;
float total_stateTax;
float total_fedTax;
float total_netPay;
};
// this structure type defines the min and max values of all floating
// point items so they can be display in our final report
struct min_max
{
float min_wageRate;
float min_hours;
float min_overtimeHrs;
float min_grossPay;
float min_stateTax;
float min_fedTax;
float min_netPay;
float max_wageRate;
float max_hours;
float max_overtimeHrs;
float max_grossPay;
float max_stateTax;
float max_fedTax;
float max_netPay;
};
// define prototypes here for each function except main
struct employee * getEmpData (void);
int isEmployeeSize (struct employee * head_ptr);
void calcOvertimeHrs (struct employee * head_ptr);
void calcGrossPay (struct employee * head_ptr);
void printHeader (void);
void printEmp (struct employee * head_ptr);
void calcStateTax (struct employee * head_ptr);
void calcFedTax (struct employee * head_ptr);
void calcNetPay (struct employee * head_ptr);
void calcEmployeeTotals (struct employee * head_ptr,
struct totals * emp_totals_ptr);
void calcEmployeeMinMax (struct employee * head_ptr,
struct min_max * emp_minMax_ptr);
void printEmpStatistics (struct totals * emp_totals_ptr,
struct min_max * emp_minMax_ptr,
int theSize);
int main ()
{
//******************************************************************
// set up head pointer in the main function to point to the
// start of the dynamically allocated linked list nodes that will be
// created and stored in the Heap area.
//******************************************************************
struct employee * head_ptr; // always points to first linked list node
int theSize; // number of employees processed
// set up structure to store totals and initialize all to zero
struct totals employeeTotals ={0,0,0,0,0,0,0};
// pointer to the employeeTotals structure
struct totals * emp_totals_ptr = &employeeTotals;
// set up structure to store min and max values and initialize all to zero
struct

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Programming Questions!