CIS12 Programming Assignment #3 - EDIT Data
This program should read a file and edit the data to make sure that the data meets the required specifications. Records that meet the specifications should be written on the output disk file. Errors should be printed out on the Error Report.
Below I have listed a series of checks that have to be made. If you do 5 of these checks, you can get a B on this program. If you do all of the checks you can get an A in this program.
Input Record Layout: (EDITDATA.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. |
|
|
|
Disk Output:
Records that have no errors are written to the disk file. The record being written should have the same layout as the record that was read.Printer Output:
When an error is found a line should be written to the output print report. If multiple errors are found on a record, multiple lines should be written on the report. The line on the report should contain the following information:The report 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.