      PROGRAM PGM01R
***********************************************************
*    PROGRAMMER: B. Alex Bridges
*    CLASS:      9:00AM
*    PROGRAM:    PGM01R.F
*    DUE DATE:   01/14/99
*
* These modifications will allow the user to enter additional
* data sets without restarting the program and indicate to the
* user when the program has terminated.
*
* Program Description:
*    This program calculates the amount of a radioactive
*    substance that remains after a specified time, given
*    an initial amount and its half-life.
* Variables:
*    INIT   : initial amount of substance
*    HFLIFE : half-life of substance
*    TIME   : time at which the amount remaining is calculated
*    RESID  : amount remaining
* Input     : INIT, HFLIFE, and TIME
*   NOTE: the value 999 for INIT will terminate the program . . . 
* Output    : RESID
***********************************************************
	REAL INIT, HFLIFE, TIME, RESID

* read in values for INIT, HFLIFE, and TIME.

10	PRINT *, 'Enter 999 to terminate the program -OR- '
	PRINT *, 'Enter initial amount, half-life, and time'
	READ *, INIT, HFLIFE, TIME
	IF (INIT. EQ. 999) GOTO 20

* compute the residual amount for the given time.

	RESID = INIT * 0.5 ** (TIME/HFLIFE)

* display the residual amount.

	PRINT *, 'Amount Remaining = ', RESID
	GOTO 10

* print end of program message.
20	PRINT *, 'End of program - PGM01R.F'
	END
