This program calculates the resistance of three resistors in
parallel. The algebraic formula for this calculation is : 1/Rt = 1/R1 +
1/R2 + 1/R3. If you want to use this program to calculate resistance of
two resistors in parallel. Simply set R3 to an extremely large
number.
<SCRIPT LANGUAGE = JavaScript>
var Rt // declares variable total resistance
var R1 = 1.0
var R2 = 1.0
var R3 = 1.0
var recipRt //declares variable reciprocal of Rt
var Alpha
var text1= prompt ("Enter decimal number for var R1 ","")
var text2= prompt ("Enter decimal number for var R2 ","")
var text3 = prompt ("Enter decimal number for var R3 ","")
R1 = parseFloat(text1)
R2 = parseFloat(text2)
R3 = parseFloat(text3)
recipRt = 1/R1 + 1/R2 + 1/R3;
Rt = 1/recipRt; Alpha = ("Rtotal is "+Rt);
alert(Alpha)
</SCRIPT>
Proceed
to Demonstration Page