View Single Post
Old 12-05-2004, 04:08 PM   #1 (permalink)
verdell32
Registered User
 
verdell32's Avatar
 
Join Date: Oct 2004
Posts: 35
verdell32 is on a distinguished road
Overtime project

This question is for Valmont. Would the pacheck.cpp help that you gave me; would it help with this one? Cause the output almost seems similiar I think we are just adding on the calculation of overtime?

CSIS 121 Introduction to Computer Science

Project OVERTIME




Write a program that does a payroll calculation for employees that get time and one/half for any work over 40 hours per week and double time for any work over 48 hours per week.



Interactive input:

Enter employee number: _

Enter hours worked : _



File input:
The employee’s employee number, name and pay rate are in a file called “MasterFile.dat”

Format of the data in the file:



employeeNumber ‘\t’ employeeName ‘\t’ payRate



employeeNumber is a 7 digit integer.

employeeName is a string with embedded blanks

payRate is a floating point value



Output format:

Employee Hours Pay Regular Premium Gross Net Federal State

Number Name Worked Rate Pay Pay Pay Pay Tax Tax

1234567 Joe Smith ##.# ##.## ###.## ###.## ###.## ###.## ###.## ###.##



Calculations
Federal tax is 33% of the gross pay

State tax is 6% of the gross pay



Exceptions:

If the file “MasterFile.dat” is not found or opened, display an error message and quit.



Validate the data read from the MasterFile. i.e. Make sure the employee number in the file matches the number entered interactively. If the employee numbers do not match, display an error message and quit.



Notes:

To declare a storage location for a persons’ name write this declaration:

char name[64];

:p
verdell32 is offline   Reply With Quote