View Single Post
Join Date: Jan 2008
Posts: 3,844
Reputation: VernonDozier has a reputation beyond repute VernonDozier has a reputation beyond repute VernonDozier has a reputation beyond repute VernonDozier has a reputation beyond repute VernonDozier has a reputation beyond repute VernonDozier has a reputation beyond repute VernonDozier has a reputation beyond repute VernonDozier has a reputation beyond repute VernonDozier has a reputation beyond repute VernonDozier has a reputation beyond repute VernonDozier has a reputation beyond repute 
Solved Threads: 503
Featured Poster
VernonDozier VernonDozier is offline Offline
Senior Poster

Re: Calculating resistance

 
0
  #6
Nov 20th, 2008
Originally Posted by kbpszs View Post
Ok well my assignment is to write a program to gives me the total resistance in a circuit.
The user is prompted for the resistance type and resistor value such as <1 200> 1 meaning in series, and 200 being the value of the resistor. When the user imputs -1 for the type the program stops and gives the total resistance. 0 goes for the starting resistor, then 1 is for series, and 2 for parallel. Here is what i have so far, I know its not calculating correctly and I can understand what to do in my head, I just cant translate it to code :/ any help or suggestions would be great, thanks

An example of what a user would input would be
0 100
1 100
1 100
2 200
2 200
1 25
2 200
1 50
-1
And the total resistance would be 100.
Maybe I am misunderstanding the input. I don't understand the (0, 100) pair. "Starting resistor"? Regarding connecting resistors in series, you have 100, 100, 25, 50 in series, so at minimum, you need to add those up, right, before you even start with the parallel, which puts you way over 100 ohms total. Can you post the mathematical formula that derives 100 from those numbers? Perhaps upload a schematic? I don't think I'm picturing the circuit.
Reply With Quote