      PROGRAM CAPAC
************************************************************************
* Program to display a table of values of voltages across a capacitor  *
* A function subprogram is used to compute these values.  Identifiers  *
* used are:                                                            *
*     V             : function subprogram that computes voltages       *
*     START, FINISH : the first and last times                         *
*     STEP          : step size for times in the table                 *
*     TIME          : DO loop control variable                         *
*     VOLTS         : voltage across the capacitor at time TIME        *
************************************************************************

      REAL V, START, FINISH, TIME, VOLTS

      PRINT *, 'ENTER THE STARTING AND ENDING TIMES AND THE'
      PRINT *, 'THE STEP SIZE TO USE FOR TIMES IN THE TABLE:'
      READ *, START, FINISH, STEP

      DO 10 TIME = START, FINISH, STEP
          VOLTS = V(TIME) 
          PRINT *, 'AT TIME', TIME, ' VOLTAGE = ', VOLTS
10    CONTINUE

      END

** V(T) ******************************************************
* Accepts:  Time T                                           *
* Returns:  The voltage across a certain capacitor at time T *             
**************************************************************

      REAL FUNCTION V(T)
      REAL T

      V = (T + 0.1) * EXP(SQRT(T))

      END

