Assignment-6 Solution

$35.00 $29.00

​100 points Overview For this assignment, you will write a program that will read a file containing information about clients: names, passwords, account balances and ID numbers. The information will be stored in a table. The table will be printed and some statistics will be computed. In particular, this program will make use of external…

5/5 – (2 votes)

You’ll get a: zip file solution

 

Description

5/5 – (2 votes)

100 points

Overview

For this assignment, you will write a program that will read a file containing information about clients: names, passwords, account balances and ID numbers. The information will be stored in a table. The table will be printed and some statistics will be computed.

In particular, this program will make use of external subroutines, character data and packed decimal numbers.


Input

The input to the program will be a file with an unknown number of records. Each record represents a single client of Familiar Names, Inc. and has the following format:

     columns         description
     -------         -----------
      1 - 10         First Name (characters)
     11 - 12         not used (periods)             
     13 - 22         Last Name (characters)
     23 - 24         not used (periods)
     25 - 32         Password (characters)
     33 - 34         not used (periods)
     35 - 43         ID Number (characters)
     44 - 45         not used (periods)
     46 - 53         Expiration Date (Year, Month, Day)
     54 - 55         not used  (periods)
     56 - 62         Balance (numeric, a number of pennies)
     63 - 80         not used (blanks)

A positive balance indicates that the client owes us money, and a negative balance indicates that we owe the client money.

Use the following JCL statement to specify the input file:

//FT05F001  DD  DSN=KC02314.SUMMER18.CSCI360.HW6DATA,DISP=SHR

Processing Requirements

The main program will carry out the following steps:

  • Call subroutine BUILD to read the file and store the data in a table. BUILD will store the number of entries in a numerical field passd in as a parameter.

  • Call subroutine PRINT to print the contents of the table, using appropriate page and column headings. The page heading should include a page number.

  • Call subroutine TALLY to compute and print:

    • the number of clients

    • the sum of all account balances

    • the average account balance

    • the largest account balance

    • the number of negative account balances

These can be added at the end of the last page.


Other Notes

  1. You may assume that the table needs to hold no more than 70 values. Each entry should have the following format:

    • Last Name (10 characters)

    • First Name (10 characters)

    • ID Number (9 characters)

    • Password (8 characters)

    • Balance (5 packed decimal bytes)

    • Expiration Date (5 packed decimal bytes)

    • Filler (1 blank)

Immediately before the line of code that declares the table, put in this line:

         ORG   PROG6+(*-PROG6+15)/16*16

The effect of this line of code will be to align your table on a 16-byte boundary (an address which is a multiple of 16). This will be helpful if and when you XDUMP the table. If your main program is not called PROG6, use its name in place of PROG6.

  1. Write this program incrementally, one subroutine at a time. Start with BUILD and XDUMP the table to see whether BUILD is correct. (Remove the XDUMP later.) After that, write and test PRINT. Once you have PRINT working, you can go on to TALLY.

  2. The JCL for this assignment is the same as the JCL used in Assignments 4 and 5 except for the line given above to provide the data.

  3. You may not use XDECI or XDECO anywhere in this assignment. The numbers should all be stored in packed decimal format.

  4. When you print amounts of money, print a leading dollar sign, a decimal point and two digits to the right of the decimal point. If an amount of money is negative, print CR to the right of the value.

  5. When you print a date, print it in the format Year/Month/Day, as in 2018/01/23.


Output

The page header for the report should start at the top of a new page. The page heading should be centered. The line of column headings should be underlined and it should be double-spaced from the page header. The lines of client information should be double spaced. The summary lines should be triple-spaced from the last client record. Print no more than 20 lines of client information per page.

Assignment-6 Solution
$35.00 $29.00