CIS 2003 - Introduction to C++ and C Programming
Bob Comer, Professor, CIS/CSC


Assignment 6 - Payroll Program

Be sure to read chapters 11 and 14 before starting this assignment. Your job is to write a payroll program for Armadillo Automotive.

Program input

The program input consists of two files - a master file and a transaction file.

Master file

The master file has one line of input per employee containing:

You can assume a maximum of 100 employees.

Transaction file (weekly timesheet information)

The transaction file has one line for each employee who worked containing:

This file may have any number of transactions.

Calculations

Program output

The program output will consist of two reports:

Error and Control Report

Payroll Report

The payroll report should be printed in a tabular (row and column) format with each column clearly labeled. Print one line for each transaction that contains:

The final line of the payroll report should print the total amount of gross pay and total amount of net pay for the week.

Hints:

  1. Global variables are variables that are declared outside any function. Do not use global variables in your programs. Declare all your variables inside functions
  2. You can assume that the Master file does not contain errors (error checking is done by another program). Error checking for the Transaction file is described in the Error and Control Report.
  3. You should use either a class or a struct to represent the master file information for one employee.
  4. Write the reports to two separate output files.
  5. The master file information should be read into an array.
  6. Do not read and store the transaction information in arrays. When you store transactions in arrays, you set a limit on the number of transactions your program can process. For this program, you should be able to read and process transactions one at a time.

Return to C++ Home Page

Copyright: Ó2000 by the Austin Community College
Department of Computer Studies. All rights reserved.
Comments to:
Bob Comer
Last updated: April 5, 2000