I have pretty much just started really learning how to program this calculator. I am loving it. Now, I can pretty much create a program for answering a question that is going to stay in the same format. What I am wanting to learn is how I can become more advanced so that I can build it to adapt to more variables for the situation. I am currently enrolled in a AC electronics class and would like to be able to set a program up to be able to take into account say the number of specific components, asking how they are connected (series or parallel), and being able to call functions when needed. Here is an example of my most recent program. It is good but, I would like to make it a lot more flexible.
Define LibPub capsprc()= Prgm :DelVar volts :DelVar freq :DelVar resist1 :DelVar resist2 :DelVar cap1 :DelVar cap2 :DelVar xc1 :DelVar xc2 :DelVar imp :DelVar tc :DelVar rc1 :DelVar rc2 :DelVar vab :Request "What is the voltage?",volts :Request "What is the frequency?",freq :Request "What is the resist1?",resist1 :Request "What is the resist2?",resist2 :Request "What is the cap1?",cap1 :Request "What is the cap2?",cap2 :setMode(1,6)*setMode(3,3)*setMode(4,3)*setMode(2,2) :xc1:=((1)/(2*π*freq*cap1)) :xc2:=((1)/(2*π*freq*cap2)) :imp:=((resist1-*xc1)^(−1)+(resist2-*xc2)^(−1))^(−1) :tc:=((volts)/(imp)) :rc1:=((resist2-*xc2)/(resist1-*xc1+resist2-*xc2))*tc :rc2:=((resist1-*xc1)/(resist1-*xc1+resist2-*xc2))*tc :vab:=((−*xc1)/(resist1-*xc1))*volts-((−*xc2)/(resist2-*xc2))*volts :Disp "Total impedence is ",imp,"ohms." :Disp "Total current is ",tc,"amps." :Disp "Current over resist1 is ",rc1,"amps." :Disp "Current over resist2 is ",rc2,"amps." :Disp "Vab is ",vab," volts." :EndPrgm
This code is running great.