The George Washington University
School of Engineering and Applied Science
Department of Computer Science

CSci 51 -- Introduction to Computing – Spring 2002

Project #5
Due Date: Start of Class, Thursday, March 7, 2002

The purpose of this project is to give you some practice working with files and extending a solution

Everything you need is in Chapters 1-6. A short introduction to files will be given in labs.

Develop a program to compute a company’s payroll summary. The payroll information is stored in a text file, the contents of which look like this:

 

4

1234 6.75 39

2345 7.15 48

3456 20.25 81

4567 9.00 80

 

The first number represents the number of employees listed in the file (there are four employees in this example file, your files will vary). On each line after the very first is an employee number, an hourly pay rate, and the number of hours worked. Employee number 1234 is paid $6.75/hr and worked 39 hours this pay period.

 

Your program will read data from a payroll file and compute the gross and net pay for each employee. After all employees have been seen, the program will then display the total mount of gross pay and the total amount paid in taxes (not the total net pay). The output should be written to an output file and should be formatted like this:

 

Emp #     Gross          Net

*****     *****          ***

1234      $263.25        $223.76

2345      $343.20       $291.72

3456      $1640.25      $1392.81

4567      $720.00       $612.00

 

Total Gross: $2966.70

Total Taxes: $446.41

 

Use table 5.6 on page 178 of your book to compute the taxes.

 

 

 

What to submit: See the document Preparation and Grading of Programming Projects for details. Your test plan and associated test program should include a proper set of tests for each of the two functions.