Question

CODE IN JAVA PROGRAMMING A resistor is an electronic component that impedes the flow of current....

CODE IN JAVA PROGRAMMING

A resistor is an electronic component that impedes the flow of current. The amount of impedance (ignoring any inductive or capacitive qualities) is called resistance and is defined in ohms.

You can combine two resistors together in parallel (both leads--wires coming out of the device--of the resistor are wired together) or in series (one lead of one is connected to only one lead of the other) to create a new effective resistance.

The formula for two resistors in series is:

R efffective=R1 + R2

The formula for two resistors in parallel is:

R efffective=R1R2 / R1+R2

Write a method that calculates the effective resistance for any two resistors, either in parallel or in series. To determine which formula to use pass in either P or S for parallel or series.

Assume that the values provided for the method are "normal," e.g. you do NOT have to anticipate problem conditions.

Homework Answers

Answer #1

public static double effectiveR(double r1, double r2,String type){
if(type.equals("S")){
return r1+r2;
}else if(type.equals("P")){
return 1/(1/r1+1/r2);
}else{
return -1;
}
}

Know the answer?
Your Answer:

Post as a guest

Your Name:

What's your source?

Earn Coins

Coins can be redeemed for fabulous gifts.

Not the answer you're looking for?
Ask your own homework help question
Similar Questions
1. Two resistors in series can act together as one resistor with a resistance called the...
1. Two resistors in series can act together as one resistor with a resistance called the equivalent resistance. If the resistance of the two resistors are R1 and R2, where R1 > R2, rank the two resistance and the equivalent resistance in order of small to large. Give a conceptual explanation. 2. Two resistors in parallel can act together as one resistor with a resistance called the equivalent resistance. If the resistance of the two resistors are R1 and R2,...
Resistor R1=3.7 Ohm is connected in series to parallel combination of resistors R2=7.9 Ohm and R3=11.1...
Resistor R1=3.7 Ohm is connected in series to parallel combination of resistors R2=7.9 Ohm and R3=11.1 Ohm. Find equivalent resistance of this combination. Give answer in Ohms. Resistor R1=3.7 Ohm is connected in series to parallel combination of resistors R2=7.9 Ohm and R3=10.7 Ohm. This combination is connected to the ideal battery of V=10.6 V. Find current through the R3. Give answer in A.
5. How are the two headlights on a car wired? in series or in parallel? Explain....
5. How are the two headlights on a car wired? in series or in parallel? Explain. 6. Three resistors R1 = 0.1 Ω, R2 = 0.2 Ω, and R3 = 0.3 Ω are connected together in an electric circuit. What is the effective resistance in the circuit if they are connected in: (a) series in the circuit, (b) parallel in the circuit.
Consider a simple circuit with two resistors connected in parallel. R1 = 30.0 Ohm, R2 =...
Consider a simple circuit with two resistors connected in parallel. R1 = 30.0 Ohm, R2 = 10.0 Ohm, and a 12 V battery Calculate the following values to one decimal places (enter just the number) The equivalent resistance  Ohms The voltage across resistor R1  V The voltage across resistor R2  V The current through resistor R1  A The current through resistor R2  A Consider a simple circuit with two resistors connected in series. R1 = 1.0 Ohm, R2 = 7.0 Ohm, and a 12 V...
a) If you have one resistor in series (R1) and two resistors in parallel (R2 and...
a) If you have one resistor in series (R1) and two resistors in parallel (R2 and R3), what value of R3 would make the effective resistance of the circuit equal to R1 and why does that work? b) If the effective resistance of the same circuit is 5kOhms, the length is 0.03m and width is 0.02m and we power the circuit by making the B field increase by 5T every second, what is the current in the circuit. Include both...
Resistor R1=3.0 Ohm is connected in series to a parallel combination of R2=9.0 Ohm and R3=7.0...
Resistor R1=3.0 Ohm is connected in series to a parallel combination of R2=9.0 Ohm and R3=7.0 Ohm. The combination of three resistors is connected to a real battery of emf 12.0 V. Find internal resistance of a battery if current through a battery is 0.40 A. Give answer in Ohms.
Two resistors (R1 & R2) when connected in series have an equivalent resistance of 9 Ohms,...
Two resistors (R1 & R2) when connected in series have an equivalent resistance of 9 Ohms, and when they are connected in parallel, have an equivalent resistance of 2 ohms. Calculate the individual values R1 and R2.                                                                                                                 The resistance of a wire is 60 Ω. Find the resistance of another wire, having double the length, three time the area and half the resistivity of the first one.                                                            Given resistors 2 Ω, 4 Ω and 6Ω, design the combination...
(1)(A)What resistance do you need to connect in parallel to a 120 Ω resistor to get...
(1)(A)What resistance do you need to connect in parallel to a 120 Ω resistor to get a total of 51.0 Ω? (B)You have in your possession numerous resistors with a value of 3.50 mΩ each. hat is the smallest number you could hook together to get an effective resistance of 1.505 Ω? (Enter the smallest possible whole number of resistors.) (C)Your car's 27.7-W headlight and 2.75-kW starter are ordinarily connected in parallel in a 12.0-V system. What power would one...
Choose true or false. True False Two straight wires carry electric currents in the positive directions...
Choose true or false. True False Two straight wires carry electric currents in the positive directions along the x- and y-axes. In the first quadrant, the magnetic field is directed out of the plane of the paper in some places, into the plane of the paper in other places, and in some places it is zero. True False  A parallel-plate capacitor has a capacitance of 10 mF and is charged with a 20 V power supply. The power supply is then...
1. What resistance can be connected in parallel with a 20 Ω to obtain the equivalent...
1. What resistance can be connected in parallel with a 20 Ω to obtain the equivalent resistance as 4Ω? Group of answer choices 3 10 5 15 What resistance can be connected in parallel with a 20 Ω to obtain the equivalent resistance as 4Ω? Group of answer choices 3 10 5 15 2.   A battery ε = 40 V with internal resistance (r) of 1 Ω is connected in series with two resistors R1 = 22 Ω and R2...
ADVERTISEMENT
Need Online Homework Help?

Get Answers For Free
Most questions answered within 1 hours.

Ask a Question
ADVERTISEMENT