Program Three Design and Function Prototypes


Main Routine
   Open time card file
   Read in first employee info
   Process first employee
   Read in second employee info
   Process second employee
   Read in third employee info
   Process third employee
   close file

Read in employee info
   read in employee file name
   read in hours worked

Process employee
   Read employee information from employee file
   Process employee payroll
   Write new employee information to employee file
   Print information to screen

Read employee information from employee file
   Open the employee file
   Read hourly wage
   Read employee name
   Read year to date hours
   Read year to date pay
   Read employee number
   Close employee file

Process employee payroll
   Current pay = current hours * hourly wage
   Year to date hours += current hours
   Year to date pay + current pay

Write employee informatino to employee file
   Open employee file for output
   Write hourly wage
   Write employee name
   Write year to date hours
   Write year to date pay
   Write employee number
   Close employee file.

Print to Screen
   break the name into first name and last name
   Print first name
   Print last name
   Print hours worked
   Print current pay


Function Prototypes

void ReadFromTimeClockFile(ifstream & file, string & fileName, float & hours);

void ProcessEmployee(string fileName, float hoursWorked);

void ReadEmployeeFile(string fileName, float & hourlyWage, string & name, string &  employeeNumber, float &  yearToDayHours, float & yearToDatePay);

void WriteEmployeeFile(string fileName, float hourlyWage, string name, string employeeNumber, float yearToDayHours, float yearToDatePay);

void ProcessEmployee(float hourlyWage, float hoursWorked, float & currentPay, float & yearTodateHours, float & yearToDatePay);

void PrintToScreen(string employeeFullName, float hoursWorked, float currentPay);