COBOL - Lab Assignment #4

Internet COBOL - program 4
Objectives:



This should supplement your previous programs to gain additional insight and program on your own. You have an input file like this:


columns 1 - 5:  account number
columns 6 - 20:  account holder name
columns 21 - 25:  principle (amount borrowed) (99999)
columns 26 - 29:  interest rate (V9999)
columns 30 - 32:  number of days

Output:

Have three heading lines:

Have a detail line giving the

Include two summary lines to print out the total in interest and the total amount due. (You will need to accumulate these values each time through the processing loop like this:)

ADD INTEREST-AMOUNT TO TOTAL-INTEREST.

ADD TOTAL-AMOUNT-DUE TO GRAND-TOTAL-DUE.

After the processing (in the 4000 termination paragraph), you will need to move TOTAL-INTEREST to TOTAL-INTEREST-OUT - and write it; and do the same for GRAND-TOTAL-DUE to get your two summary lines.



Processing: Read the input file and calculate the amount of simple interest (I = Principles * Rate * Time). Also calculate the total amount due after the period. To calculate the interest - use a compute statement like this:


  COMPUTE INTEREST = PRINCIPLE-IN * RATE-IN * DAYS-IN / 365.

To change the interest into a percentage for output:


  MULTIPLY RATE-IN BY 100 GIVING RATE-OUT.
(be sure NOT to move RATE-IN to RATE-OUT - 
 as that would "undo" the multiplying by 100)

                        FIRST NATIONAL BANK OF CINCINNATI
                             SHORT TERM LOAN REPORT

   NAME               PRINCIPLE     RATE    DAYS    INTEREST       TOTAL

   Farrell, Tom        $10,000      8.75      60     $143.83     $10,143.83
   Molstad, Lynn        $5,000      9.50     123     $160.06      $5,160.06
   Daniel, Connie       $2,575     10.25      45      $32.54      $2,607.54
   McKeown, Jim         $8,995     12.75      87     $273.36      $9,268.36
   Dennis, Terry       $12,350      9.75      93     $306.80     $12,656.80
   Webster, John        $2,500      8.00      54      $29.58      $2,529.58
   Coffey, Deb          $3,525     12.25     125     $147.88      $3,672.88
   Christoph, Rick      $6,750      8.75     121     $195.79      $6,945.79
   O'Brien, Peg        $10,500      9.00      54     $139.80     $10,639.80
   Beckman, Ron        $12,350      9.75     111     $366.18     $12,716.18
   Puetz, Rick          $4,125     10.25      95     $110.04      $4,235.04
   Talley, Dan         $12,139      8.50      61     $172.44     $12,311.44
   Goeden, Rose         $8,500      9.25      81     $174.48      $8,674.48
   Havlik, Joyce       $13,102      9.00      50     $161.53     $13,263.53
   Bennett, Dorine      $3,450      8.75      37      $30.60      $3,480.60

   TOTAL INTEREST DUE:                $2,444.91

   GRAND TOTAL DUE:                 $118,305.91

Your program will: 

Include accumulating the total interest and the grand total due and writing them out.

You will need two output lines (summary lines). You will need accumulators defined in the data division, and you will need to add to those accumulators in the procedure division.

Here is the data file:

Notice that I wrote the summary lines with a floating dollar sign (which will be covered later). You can try to get output like mine, or settle for something similar, but at a minimum, zero suppress the output!!!


Deliverables 

Last modified by Bruce White on 02/02/04

Return to main menu