LAB3                             Football PROJECT                      CSE314 Spring 2005

Assigned

Due

Goals

FYI

Project Information

PROBLEM:   Write a program, called lab3.cob using file I/O to output the input information in report format.   The input file can be accessed or copied from the following location:  /usr/class/cis314/sp05/lab2player.dat.  You will have a second input file which you will create yourself as explained below.

Ø      This lab currently only includes the information for ONE game played.  That is, “teamAvsteamB” on a particular date.  There will only be a sample of input records from each team and the individual statistics per player.  Some players may have multiple input records, but that is not an issue this lab will be addressing.

Ø      Before submitting your lab, you MUST be sure to list the entire input file location given above on your select statement.  Points will be deducted if you forget since the program will not be able to find the input file!

Ø      You do not know the number of records in the player input file, so you must check for end of file.

 

INPUT FILE RECORD LAYOUT for lab2gamein.dat

You create this file however you like using the below given data and details.  You should not need to check for EOF (although you can if you want) since you know the exact format and number of records in the file.

§         date game played – numeric length 6

§         The real name of TeamA – you determine the length and type

§         The real name of TeamB – you determine the length and type

 

INPUT FILE RECORD LAYOUT for lab2player.dat

It is possible that the data in this file will change, so don’t base your program on the exact data values.  However, the format (i.e. types and lengths) of each field will need to stay exactly the same.

§         player’s name – alphanumeric length 18

§         team name – alphanumeric length 14; file value is either TeamA or TeamB. 

§         player’s position – alphanumeric length 15

§         plays offense, defense or special teams – alphabetic length 1; this field will have an “O”, “D” or “S” for offense, defense or special teams respectively

§         statistics, each with numeric length 2:

1.       number of sacks

2.       number of interceptions

3.       number of carries

4.       passes received

5.       number of punts

6.       number of kickoffs

OUTPUT FILE LAYOUT

The output file report should look similar to the following with the name lab3out.dat (again, be sure to use this name so the grader doesn’t have to look up the name of the output file when grading).  The changes from lab2 are noted in gray.

Sample Output Report:

(no blank line here!)

current date: mm/dd/yyyy                                                        current time:  HH:MM:SS

            *** blank line

Team A:  name of teamA here (from lab2gamein.dat that you created)

Team B:  name of teamB here (from lab2gamein.dat that you created)

         ***blank line                                 

                                 your team name A        VERSUS        your team name B

                                                           game date:  mm/dd/yy

         ***blank line

                                                                                         Passes     Interceptions        Kick

Team Name     Player Name      Position     ODS     Carries         Sacks              Punts   offs

         ***blank line

è individual player data goes here!  one line per player; no blank lines in between

         ***blank line

STATISTICAL INFORMATION

Total number of players:                     ???????

Total number of passes:                      ???????

Total number of interceptions:             ???????

Percent of passes were interceptions:           999.9% (edited)

         ***blank line

END OF REPORT

 

Output File Description:

Ø      You only have ~80 (actually up to 85, I believe) positions across your printer paper.  You need to be sure that your report will fit on the paper.  The above sample may need to be changed somewhat to accommodate this.  Three options include: (1) abbreviating the column headers  (2) staggering the column headers on two lines, or (3) creating a legend or key between the definition of team names and the VERSUS line. 

Ø      The output data was put in a different order than the input data on purpose!

Ø      Be sure to include the blank lines as shown above

Ø      The current date should be left justified and the current time should be right justified on the first line of the output file.  The format seen here is exactly what you should have in your output file (labels, entire year of length 4, colons between hours and minutes, and minutes and seconds, etc)

Ø      The VERSUS line needs to be centered over the column headers

Ø      Notice the date under the VERSUS line was updated a bit to say “game date” instead of just “date”.

Ø      Column headers need to be underlined INDIVIDUALLY.  If you have more than one column heading line, the underline should only be on the part of the header that is the “bottom” of the column description.  You can underline the entire length of the column field, if you like (different from above), but you CANNOT underline the blank spaces in between each column header field!  !  For instance, the column header “Player’s Name” is 13 characters in length, but the maximum field length is 18.  If you want to continue the underline for “Player’s Name” out 5 more spaces to the maximum length of the data under that column, that is okay.

Ø      The player data should all line up nicely under the column headers.

Ø      The total number of players should be the same as the number of records in the player file

Ø      The  percent of passes that were interceptions should look similar to what is given (but edited)

Ø      The data should be edited whenever possible!

Ø      The last line in the output file should be the “END OF REPORT” line

External Documentation

Discussed in class; there is no external documentation required for this lab.

Submitting Project Files

When you are finished with the lab, submit the following files for grading:

 

See Lab1 for information on how to use a submit command.  Also, note that programs must be submitted in source code form. For example, if you submit "lab2.acu" instead of "lab2.cob", you will have, at a minimum, points deducted equivalent to submitting a day late (20%).

Deleting Unnecessary Files

See Lab1 for information about deleting unnecessary files.