Program 3, Payday!

Short Description:

Write a program which will process the payroll for a small company.

This assignment is worth 50 points.

Goals

When you finish this homework, you should have:

Formal Description

You have been asked by a friend who runs a small company to help write a program which computes payroll for their company. Your friend's company has a total of three employees, and they process the payroll once a week.

Your friend has a time system which produces a file each week called master.lst. This file contains three lines, each represent the base name of an employee file. An example of this file might be:

BobSmith
JoanRocklish
RobertJohn

Each employee has a data file which contains:

An employee data file name is found by appending ".dat" to the base name from the file master.lst. So, for the above example, BobSmith.dat might contain the following:
Robert E Smith
40.0  25.33
President of the Company.
For the given master.lst file, there will also be files JoanRocklish.dat and RobertJohn.dat. For other master.lst files, the data file names will be different. You should determine the names of the employee files by reading data from master.lst.

Your program should process each employee input file, creating an output file for each employee. The output file name can be constructed by appending ".report" to the end of the base name. Continuing the example, BobSmith.report would be produce by processing BobSmith.dat. The output file should contain the following text, with areas marked <value> replaced by the value either input from the input file or computed from data in the input file.

Dear <Employee Name>
Last week you worked a total of <Hours Worked> hours.
Your pay rate is < Pay Rate> per hour.
The amount $ < Pay Amount> has been electronically deposited in your account.

We appreciate your service as < Job Description>.

In addition, you should produce a final file called payroll.out which contains one line per employee which contains:

The file should end with a line which contains

Discussion

You need to create four files with your text editor.

Your program will create four output files

All dollar amounts in your program should be formatted with a dollar sign and correct to two decimal places.

There is no user interaction for this program. It should run without producing output to the screen.

Your identifiers should be constructed properly, with meaningful names.

You should document your code with comments.

Your output should be organized, easy to read, and make appropriate use of white space.

Design

See homework number 9.

Required Files

A single source code file.

Submission

Email your final source code file to danbennett360@gmail.com.