CSCI 360 Spring 2014

Program 2
Loops & X-Instructions
(100 points)


Overview

For this program, expand on Program 1 by writing and executing a program that will calculate the points for multiple hockey players.

Input

The input for the program will come from a file with an unknown number of records, each of which represents a single hockey player. Each record contains two numbers that are separated by at least one space:

Processing

The processing for this program will utilize a read loop to process all of the records (players) in the input file.

For each player:

After all of the player information has been displayed, display the number of players and the total number of points for all of the players.

The following is suggested Logic for this program:

Initialize any counters or totals that are needed

Read the first input record

While there are input records
  Get the 2 pieces of information from the input file

  Calculate the number of points

  Build and display the print line

  Increment the number of players and the total number of points

  Read the next input record
Endwhile

Display the number of players and the total number of points

Processing Requirements

  1. Using Blackboard, hand in copy of the source code *AND* a copy of a run of this program from the Marist system.

  2. Use TITLE 'Your Name, Class, Section, Assignment Number'.

  3. Use XREAD, XPRNT, XDECI, and XDECO for Input/Output operations.

  4. Include Line Documentation (known as 'Line Doc') following the operands on all lines. This is in addition to the prescribed Documentation Box (known as 'Doc Box') that you must provide at the start of every program.

  5. Write (XPRNT) a "top of page header" that says 'Hockey Player Information'. Use the following Carriage Control Characters to position the lines of output:

  6. C'1'  (one) ----- Top of Page
    C' '  (blank) --- Single Space
    C'0'  (zero) ---- Double Space
    C'-'  (minus) --- Triple Space
    
  7. The column header should be double spaced from the "top of page header". The player information should be double spaced. The first line of summary information (number of players) should be triple spaced from the last line of player information. The second line of summary information (total number of points) should be single spaced from the first.

  8. Include the following JCL statement to access the input file:

  9. //FT05F001 DD DSN=KC02330.CSCI360.FILES(DATA2),DISP=SHR

  10. The JCL for the program should now look like:

  11. //your_KC_id_plus_a_letter JOB ,'your name',MSGCLASS=H
    //STEP1 EXEC PGM=ASSIST
    //STEPLIB DD DSN=KC02293.ASSIST.LOADLIB,DISP=SHR
    //SYSPRINT DD SYSOUT=*
    //SYSIN DD *
    ********************************************
    *
    *  The program goes here
    *
    ********************************************
    /*
    //FT05F001 DD DSN=KC02330.CSCI360.FILES(DATA2),DISP=SHR
    //
    

Notes

  1. When you are debugging logic errors, don't be reluctant to use XDUMP instructions to display registers and/or memory. Once you get the program running, remove the XDUMPs from the run that is turned in for grading.

  2. Feel free to test the program with your own data. Simply leave out the FT05F001 statement in the JCL that was given above and place your data after the assembly END statement. It is important that the data you enter follows the same format as the grade run input file. For example:

             END   MAIN
    172  308
    214  226
    184  236
    /*
    //
    

    Make sure that the run you hand in for grading uses the file specified above and contains nothing after the END statment.

Output

The output should be neatly formatted and the heading(s) should be centered over the output columns. SAMPLE OUTPUT FOLLOWS based on data consisting of only the first three input records:

Note: As below, the output should have the carriage control characters rather than blank lines.

1               Hockey Player Information                                                                                         
0       Player #     Goals      Assists     Points                                                                                
0           1         172         308         480                                                                                 
0           2         214         226         440                                                                                 
0           3         184         236         420                                                                                 
-       Number of players:                  3                                                                                     
        Total Number of points:          1340