Older Version Newer Version

cogburn cogburn May 23, 2012

**Radioactive Decay Isotope Predictor**

Chemistry or physics teachers should find this program useful to predict the mass and atomic number of the isotope that results from one of 4 different types of radioactive decay.

[[code format="lb"]]
'Radioactive Decay Program Version 1.0
'May 2011
'by Scott Ausbrooks
'this program calculates the mass and atomic number of a radioactive isotope
'after one of 4 types of decay.

nomainwin
array$(0) = "alpha decay"
array$(1) = "beta decay"
array$(2) = "positron emission"
array$(3) = "electron capture"

WindowWidth = 700
WindowHeight = 440
'groupbox #1, "Choose One",5,5,400,300
combobox #1.combo1, array$(, [action],20,50,240,200
textbox #1.textbox1, 460, 120, 150, 50
textbox #1.textbox2, 460, 20, 150, 50
textbox #1.textbox3, 460, 220, 150, 50
textbox #1.textbox4, 460, 320, 150, 50
statictext #1.choose, "Choose Type of Decay", 20,90,350,40
statictext #1.atomicnumber, "Atomic number",350,120,80,80
statictext #1.atomicmass, "Atomic mass",360,25,80,80
statictext #1.resultsmass, "mass =",380,230,70,80
statictext #1.resultsnumber,"Z = " ,410, 320,50,80
button #1.button1, "E&xit", [quit], LL, 60, 60 'create a button
open "Radioactive Decay" for window as #1
print #1, "font times_new_roman 18 BOLD"
print #1, "trapclose [quit]"
wait

[action]
print #1.combo1, "selection?"
input #1.combo1, decay$

print #1.textbox1,"!contents?"
input #1.textbox1,atomicnumber$

print #1.textbox2,"!contents?"
input #1.textbox2,atomicmass$

SELECT CASE decay$
 CASE "alpha decay"
print #1.textbox4, val(atomicnumber$)-2
print #1.textbox3, val(atomicmass$) - 4
 CASE "beta decay"
 print #1.textbox4, val(atomicnumber$) +1
print #1.textbox3, val(atomicmass$)
 CASE "positron emission"
 print #1.textbox4, val(atomicnumber$)-1
print #1.textbox3, val(atomicmass$)
 CASE else
 print #1.textbox4, val(atomicnumber$)-1
print #1.textbox3, val(atomicmass$)
END SELECT
wait
[quit]
confirm "Really quit?";answer$
if answer$ = "no" then wait
close #1:end

[[code]]