Lab 5

Goals

Use edited output for all output information

Part A – Perform/If Statements

Write COBOL programs to determine the number of each type of instrument in the Columbus Children’s City Band. The possible types of each instrument are woodwind, brass, percussion, extra or other (described below).

Copy the input file, ~sgomori/students/cis314/lab5ain.dat, into your directory. Your program is not to specify a path for this input file. Each input record has the following specification (there are exactly 45 records in the file):

Output the number of each of the five different types of instruments found in the band (choose what the output looks like). The output goes to the screen, but you will need to include some logic to “freeze” the output on the screen so you can read it. When the program ends, the terminal window will partially destroy the output. So you need to make it so that it shows all the totals, then has a “Press Enter to continue …” prompt. The program does not end until enter is pressed.

Write COBOL programs as specified below. They should produce the same output, they just take different approaches.

Part B – Double Control Break Algorithm

Write a COBOL program named lab5b.cob to perform the following (This program will be similar to lab4b.cob, which you can use as a starting point. If you were not able to complete lab4b.cob properly then see your grader/lecturer for help in correcting your program).

Many hospitals are a part of the United Healthcare of Ohio (UHOH) Insurance system. Each hospital accepting UHOH Insurance has a unique numeric identification number. UHOH Insurance would like a report to determine the total (no averages this time) amount of unpaid bills for each individual patient as well as for each hospital. The grand total (again, no averages) of unpaid patient bills for all of the UHOH Insurance system.

INPUT DESCRIPTION

Copy the input file, ~sgomori/students/cis314/lab5bin.dat, into your own directory. Your program is not to specify a path for this input file. You do not know how many records each hospital has in the file, or how many charges each patient has. However, you do know that the input file will be sorted by Hospital Number and within Hospital Number by Patient Number. The input file has the following specifications for each input record. You may assume that there is no invalid data in this input file.

OUTPUT DESCRIPTION

The report file will be named lab5bout.dat. The output should look basically like the following:

Each Page Header should look something like this:

 
Date: MM/DD/YYYY                            NAME OF INSURANCE SYSTEM                          Page 999
Time: HH:MM:SS

The column headers, one set per page (after the page headings) should look something like this (note that instead of address we now have service type):

 
Patient             Patient                    Service              Date of           Amount
Number               Name                     Description           Service            Owed
-------     -----------------------   --------------------------    --------          -------

At the start of each set of hospital data, as well as at the top of each page (after the page and column headings) you should have something like this:

 
HOSPITAL NAME: name of hospital
HOSPITAL NUMBER: unique hospital id number

After you have printed the data for each patient you will then print the total amount owed for that patient, similar to the following (note that the patient number and name only print for the first of each patient's records):

 
00001       Griese, Brian              Ear Infection                08/24/1999             300.00
                                       Diaper Rash                  09/05/1999              25.00
                                       Frontal Labotomy             09/25/1999          25,000.00
                                       Rear Labotomy                09/26/1999          25,000.00
                                       Central Labotomy             09/28/1999          24,999.99
 
     The total amount owed for this patient is: $..........

Once the data for each hospital has printed you will output the total bill amount owed for that hospital, as you did in lab 3.

You will also output the grand total amount owed for UHOH, as in lab 3.

Submitting Lab 5

The files to submit are:

Deleting Unnecessary Files

Use the clean utility described in Lab 2.