Indiana University of Pennsylvania
Computer Science Department
CO 110  Spring 1985
Wolfe and Maple

  Programming Project #1
  (Due February 4)


    Keypunch the FORTRAN program on the back of this page EXACTLY as it appears, inserting your id on the job line, your name on line 3, and your recitation section number on line 4.   Each line is to be punched on a separate card.  This FORTRAN program consists of 49 cards.

    In addition to the FORTRAN program, the back of this page shows the Job Control Language (JCL) and data for the program.   The form of the JCL and data cards will be explained in class.   You must punch these cards exactly as shown.

    After you have punched the cards, run the program and hand in the resulting listing and output.  The correct listing and output is posted in the Computer Science Department and at the ISC Center, if you would like to check your results before handing them in.

    When you turn in the project, be sure to print the following information in LARGE BLOCK LETTERS on the outside page of the listing.

         YOUR NAME
         DATE      PROGRAM NUMBER
         CO 110    RECITATION NUMBER

    
    Note #1:  DO NOT turn in the cards with your listing.  We do not want the cards; we want only the listing.

    Note #2:  DO NOT handin the project until you are sure it is the way you want it to be graded.  DO NOT submit multiple versions of the project.

!JOB id
!FORTRAN (LS,ANS)
C         ****  SAMPLE PROGRAM  ****
C
C         KEYPUNCHED AND TESTED BY:  name
C         FOR  CO110  RECITATION NUMBER: nn
C         SPRING 1985
C
C     THIS PROGRAM CALCULATES AND PRINTS A
C     COMPOUND INTEREST TABLE COVERING A PERIOD OF 20 YEARS.
C     THE AMOUNT DEPOSITED EACH YEAR IS THE SAME (AT YEAR END).
C     THE AMOUNT OF THE DEPOSIT AND THE INTEREST RATE ARE READ IN.
C
C     TABLE OF PROGRAM VARIABLES
C
C     YEARS      CONTAINS THE NUMBER OF YEARS OF COMPOUNDING
C     DEPOS      CONTAINS THE AMOUNT OF THE DEPOSIT
C     PERCNT     CONTAINS THE PERCENTAGE OF INTEREST
C     INTRST     CONTAINS THE AMOUNT OF INTEREST EARNED FOR 1 YEAR
C     SOFAR      CONTAINS THE COMPOUNDED AMOUNT EARNED SO FAR
C
     INTEGER YEARS
     REAL DEPOS, PERCNT, INTRST, SOFAR
C
C     PROGRAM PARAMETER
C
C     TERM       THE NUMBER OF YEARS TO DO COMPOUNDING (HERE 20)
C
     INTEGER TERM
     PARAMETER (TERM=20)
C
     READ *, DEPOS, PERCNT
     PRINT *, 'THE DEPOSIT AMOUNT IS ', DEPOS
     PRINT *, 'THE PERCENTAGE OF INTEREST IS ',PERCNT,'%'
     PRINT *
     PRINT *
     PRINT *, ' INTEREST        TOTAL           YEARS'
     PRINT *, ' --------        --------        -----'
     PRINT *
     YEARS = 1
     SOFAR = DEPOS
10    IF (YEARS .LE. TERM) THEN
         INTRST = PERCNT / 100.0 * SOFAR
         SOFAR = SOFAR + INTRST
         PRINT *, INTRST,'      ',SOFAR,'        ',YEARS
         YEARS = YEARS + 1
         SOFAR = SOFAR + DEPOS
         GO TO 10
     ENDIF
     STOP
     END
!RUN
100.0  8.25