PROGRAM Radioactive_Decay
!----------------------------------------------------------------------------
! This program calculates the amount of a radioactive substance that 
! remains after a specified time, given an initial amount and its 
! half-life.  Variables used are:
!   InitalAmount    : initial amount of substance (mg)
!   HalfLife        : half-life of substance (days)
!   Time            : time at which the amount remaining is calculated (days)
!   AmountRemaining : amount of substance remaining (mg)
!
! Input:   InitialAmount, HalfLife, Time
! Output:  AmountRemaining
!-----------------------------------------------------------------------------

  IMPLICIT NONE
  REAL :: InitialAmount, HalfLife, Time, AmountRemaining

  ! Get values for InitialAmount, HalfLife, and Time.

  write(*,*) "Enter initial amount (mg) of substance, its half-life (days)"
  write (*,*) "and time (days) at which to find amount remaining:"
  READ *, InitialAmount, HalfLife, Time
 
  ! Compute the amount remaining at the specified time.
  AmountRemaining = InitialAmount * 0.5 ** (Time / HalfLife)

  ! Display AmountRemaining.
  PRINT *, "Amount remaining =", AmountRemaining, "mg"

END PROGRAM Radioactive_Decay
