program rDecay 
! Program to calculate the radioactive decay of a material.
real :: amnt_N0, amnt_t, decayC, halfLife, time

! Obtain input from the user 
write (*,*) 'What is the half life of the material (days)? '
read (*,*) halfLife 
write (*,*) 'What is the time span (days)? '
read (*,*) time 
write (*,*) 'How much of the material is needed (grams)? '
read (*,*) amnt_t 

! Calculate the decay constant
decayC = log(2.0) / halfLife
! Calculate the initial amount of the material
amnt_N0 = amnt_t * exp(decayC * time)

write (*,100) 'To obtain ', amnt_t, ' grams at the end of ', time, ' days'
100 format(A,F5.2,A,F5.2,A)
write (*,200) 'requires ', amnt_N0, ' grams of the material to start with.'
200 format(A,F7.2,A)

end program rDecay