COSC 1320 - C++ Programming
Bob Comer, Professor, CIT/COSC


Assignment 6 - Payroll Program

Be sure to read through chapter 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:

This file is ordered by ID number. 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.

Requirements:

  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. Use C strings (not the C++ string class) to represent strings in your program.
  4. You should use either a class or a struct to represent the master file information for one employee.
  5. Write the Error and Control Report to one file and the Payroll Report to a second file.
  6. The master file information should be read into an array.
  7. Do not read and store the transaction information in an array. 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: Nov. 6, 2000