Dim Float C,V,F,A,x Dim y$ 'defaults, change them if you need to V=240 F=50 Print "***************************************************" Print "* Capacitive dropper Current/Capacitor calculator *" Print "***************************************************" Do Print: Print "Which do you wish to calculate:" Print "The Current available in a circuit[A]" Print "or" Print "The Capacitance required to deliver a given current[C]" Input y$ y$=Ucase$(y$) Loop Until y$="A" or y$="C" Print "Enter Supply Voltage (Vrms): [";V;"]"; Input"", x If x Then V=x Print "Enter Supply Frequency (Hz): [";F;"]"; Input"", x If x Then F=x If y$="A" Then Input "Enter Capacitor Value (nF): ",C c=c/1e9' coz nF A=2*Pi*C*V*F*1000 Print "Available Current is : ";STR$(A, 1, 5);"mA" Else Input "Enter Desired Current (mA): ",A a=a/1e3' coz mA C=(1/(2*Pi*V*F))*A*1e9 Print "Required Capacitance is : ";Str$(C,1,3);"nF" EndIf