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 : statement function that computes voltages * * T : argument for function V * * 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 * * * * Input: START, FINISH, STEP * * Output: VOLTS * ************************************************************************ REAL T, V, START, FINISH, STEP, TIME, VOLTS V(T) = (T + 0.1) * EXP(SQRT(T)) PRINT *, 'ENTER THE STARTING AND ENDING TIMES AND' 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