This program might prove useful to chemistry or physics teachers or students.
'Halflife 2.0'by Scott Ausbrooks'May 2012'This program calculates the amount of radioactive'material remaining after "x" number of halflivesnomainwinWindowWidth=900WindowHeight=500button#1.button1,"Calculate",[action], UL,10,30,120,50button#1.button2,"Clear",[clear], LL,10,20,120,50button#1.button3,"Exit",[quit],LR,120,60,120,50textbox#1.textbox0,650,30,180,60'masstextbox#1.textbox1,650,130,180,60'halflifetextbox#1.textbox2,650,230,180,60'decaytimetextbox#1.textbox3,310,320,180,100'resultstatictext#1.originalmass,"Original Mass",550,30,100,50statictext#1.decaytime,"Decay Time",550,230,100,50statictext#1.halflife,"Half-Life",550,150,100,25statictext#1.result,"Result",365,430,100,25open"Radioactive Isotope Remaining"forwindowas#1print#1,"font times_new_roman 18 BOLD"print#1.textbox0,"!setfocus"print#1,"trapclose [quit]"wait[action]print#1.textbox1,"!contents?"input#1.textbox1, halflife$
print#1.textbox2,"!contents?"input#1.textbox2, decaytime$
print#1.textbox0,"!contents?"input#1.textbox0, mass$
numhalflife =val(decaytime$)/val(halflife$)
newmass =val(mass$)*(.5^numhalflife)print#1.textbox3,"!font times_new_roman 18 bold"print#1.textbox3, newmass
wait[clear]print#1.textbox0,""print#1.textbox1,""print#1.textbox2,""print#1.textbox3,""print#1.textbox0,"!setfocus"wait[quit]confirm"Really quit?";answer$
if answer$ ="no"thenwaitclose#1:end
This program might prove useful to chemistry or physics teachers or students.