CIS12 Programming Assignment #3 - EDIT Data

This program should be an individual effort. You know enough now to do your own work and not take excessive help from friends and classmates!

This program should take in data from the screen and edit the data.

Below I have listed your grading options:

  1. You must check and make sure the Identification # is numeric and present
  2. If you do 4 additional checks from the requirement list below, you can get a C in the program.
  3. If you do 6 additional checks from the requirement list below, you can get a B on this program.
  4. If you do all of the checks you can get an A in this program.

Below I have listed a series of checks that have to be made depending on the grading choice you make!

OUTPUT Record Layout: (GOODDATA.DAT)

Characters

Name of field

Requirements

1 - 5

Identification #

This field must be numeric and present

6 - 25

Name

This field must be present

26

Sex

This field must be M, F or Blank

27

Marital Status

This field must be M, S, W, D or Blank

28-29

# of Dependents

This field must be numeric

30

Employment Code

This field must contain a S, H, T, C

31 - 38

Salary (2 decimal places)

If employment code is an S this field must contain numeric data in the range 20000 to 120000

39 - 43

Pay per Hour (2 decimal places)

If employment code is H or T this field must contain a numeric value between the range of 6 and 10.

If employment code is C this field must contain a numeric value between 25 and 150.

If employment code is S this field must contain no data or 0 data depending on how you set up the field.

44

Withholding Code

 This field must contain T, R, C or blank

45 - 50

Withholding Amount

If withholding code has T, R or C, this field must contain numeric data.

Disk Output (GOODDATA.DAT): Records that have no errors are written to the disk file called GOODDATA.DAT. The record being written should have the layout shown above.

Disk Output (BADDATA.DAT): When an error is found a line should be written to the output disk file called BADDATA.DAT in the format for a print report. If multiple errors are found on a record, multiple records should be written to this file. The line on the file should contain the following information:

The BADDATA.DAT file should be ready to go to the printer. Therefore it should contain a page header with the date and page number, a column header and a total line containing the number of records that were valid (contained no errors) and the number of records that contained an error.

The program called SCREDIT2.CBL is the best model to look at when writing this program!

You must pass in the following:

    1. The .cbl version of your program.
    2. Your GOODDATA.DAT file.
    3. Your BADDATA.DAT file.