LAB5                             Football PROJECT                      CSE314 Spring 2005

Assigned

Due

Goals

FYI

Project Information

PROBLEM:   Write a program, called lab5.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/lab5player.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’ve already created this file.

 

INPUT FILE RECORD LAYOUT for lab5player.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 stay exactly the same.  The data in this file will be grouped by offense, defense and special teams then within by string level so that the double control break algorithm can be used.  Remember, though, that the order of the groups of data will be variable i.e. not necessarily in offense, defense, special teams order, and your program should still work!

§         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

§         first string, second string, third string, etc. – numeric length 1

§         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 lab5out.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).  Be sure to copy the way the sample report is indented, centered in places, and has blank lines - it helps with the readability of the report!  

 

Sample Output Report:

(no blank line here!)

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

          *** blank line

                 your team name A        VERSUS        your team name B

                                         game date:  mm/dd/yy

         ***blank line

TYPE-OF PLAYERS

         STRING:  value

                        Team Name      Player Name     Position  

               à individual player data goes here!

               à player name should be last name comma blank first name; no extra blanks allowed

                        ***blank line

         STRING TOTALS:

         Number of TeamA players for this string:  numeric value  (be sure to put the actual teamA name!)

         Number of Team B players for this string:  numeric value (be sure to put the actual teamB name!)

         *** blank line – repeat STRING information and totals for each string group

TYPE-OF PLAYER TOTALS:

Number of players on “teamA”:  numeric value  (be sure to put the actual teamA name!)

Number of players on “teamB”:  numeric value (be sure to put the actual teamB name!)

***blank line

***blank line – extra blank line

*** Repeat the TYPE-OF PLAYERS section along with all string groups for each group of type-of player data

SUMMARY INFORMATION

% Interceptions (for game):  total # interceptions / (total # passes + total # interceptions)

% Sacks (for game):  total # sacks / (total # sacks + total # carries + total # passes)

Number of Players for “teamA”:  use actual teamA name; assuming each player is listed as only one of ODS

Number of Players for “teamB”:  use actual teamB name; assuming each player is listed as only one of ODS

***blank line

Largest String Group

         How many:  integer value

         In group type:  offense, defense or special teams

         String Number: 1, 2, 3, etc…

Smallest String Group

         How many:  integer value

         In group type:  offense, defense or special teams

         String Number: 1, 2, 3, etc…

***blank line

END OF REPORT

 

Output File Description:

Ø      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.

Ø      Notice there is no TEAM A NAME or TEAM B NAME.  These were deleted because you will now need to output the actual team name as specified in your lab2gamein.dat file.

Ø      The VERSUS line needs to be centered over the group title and column headers.

Ø      TYPE-OF could be “offensive”, “defensive” or “special teams”.  This means that you will need to convert the “O”, “D” or “S” from the input file to one of these 3 options when printing the report.

Ø      Column headers need to be underlined INDIVIDUALLY. 

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

Ø      The information under the TOTALS line is for that group of data only.

Ø      The data should be edited whenever possible!

Ø      Be sure to use at least 2 decimal places for real values.

Ø      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.