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
cHJvZ3JhbSByRGVjYXkgCiEgUHJvZ3JhbSB0byBjYWxjdWxhdGUgdGhlIHJhZGlvYWN0aXZlIGRlY2F5IG9mIGEgbWF0ZXJpYWwuCnJlYWwgOjogYW1udF9OMCwgYW1udF90LCBkZWNheUMsIGhhbGZMaWZlLCB0aW1lCgohIE9idGFpbiBpbnB1dCBmcm9tIHRoZSB1c2VyIAp3cml0ZSAoKiwqKSAnV2hhdCBpcyB0aGUgaGFsZiBsaWZlIG9mIHRoZSBtYXRlcmlhbCAoZGF5cyk/ICcKcmVhZCAoKiwqKSBoYWxmTGlmZSAKd3JpdGUgKCosKikgJ1doYXQgaXMgdGhlIHRpbWUgc3BhbiAoZGF5cyk/ICcKcmVhZCAoKiwqKSB0aW1lIAp3cml0ZSAoKiwqKSAnSG93IG11Y2ggb2YgdGhlIG1hdGVyaWFsIGlzIG5lZWRlZCAoZ3JhbXMpPyAnCnJlYWQgKCosKikgYW1udF90IAoKISBDYWxjdWxhdGUgdGhlIGRlY2F5IGNvbnN0YW50CmRlY2F5QyA9IGxvZygyLjApIC8gaGFsZkxpZmUKISBDYWxjdWxhdGUgdGhlIGluaXRpYWwgYW1vdW50IG9mIHRoZSBtYXRlcmlhbAphbW50X04wID0gYW1udF90ICogZXhwKGRlY2F5QyAqIHRpbWUpCgp3cml0ZSAoKiwxMDApICd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