PPT Slide
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
!-----------------------------------------------------------------------------
real :: InitialAmount, HalfLife, Time, AmountRemaining
! Get values for InitialAmount, HalfLife, and Time.
print *, "Enter initial amount (mg) of substance, its half-life (days)"
print *, "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