for three resistors R1, R2 and R3. Include one or more
functions that:
a. Validates the data by ensuring a positive numeric value
was entered. If the entered number is negative or zero, a
message should display that this is not a valid resistance.
Please enter a positive number.
b. Calculates the total resistance when R1 & R2 & R3 are
in series configuration. Then display a message: "if R1,
R2 and R3 are in series, then the total resistance
is
_". Refer to the figure below. You can use the
following equation.
c. Calculate the total resistance when R1 & R2 & R3 are in
a parallel configuration. And display a message that "if
R1, R2 and R3 are in parallel, then the total resistance
is _". Refer to the diagram below. You can use the
equation.
R1
R2
R1
R2
d. Calculate the total resistance when RI & R2 are in
parallel, and the result is in series with R3. And display a
message that "if R1, R2 are in parallel and the result to
be in series with R3, then total resistance is
Refer to the figure below. You can use the equation:
R3
R3
Fig: 1