C+ (NOT C++) Resistance Caculation

  • Context: Comp Sci 
  • Thread starter Thread starter vladittude0583
  • Start date Start date
  • Tags Tags
    Resistance
Join the discussion
Registration is free. Ask a follow-up in this thread, or start your own.
4 replies · 3K views
vladittude0583
Messages
40
Reaction score
0
Our homework requires us to write a program that will calculate the total resistance of a circuit with "infinite" resistor values.

My question is, how would I calculate the "infinite" portion of the code? I already know that this will require a while loop with some if/for statements. I am just unsure of how to write the code that take will care of the "infinite" number of values of resistors.

If you could give me an idea as to how to do so it would be greatly appreciated - on a side note, I am in C+ programming and not C++ programming, so please provide me with an answer in terms of the language I am familiar too and not one above it. Thanks.
 
Physics news on Phys.org
vladittude0583 said:
Our homework requires us to write a program that will calculate the total resistance of a circuit with "infinite" resistor values.

My question is, how would I calculate the "infinite" portion of the code? I already know that this will require a while loop with some if/for statements. I am just unsure of how to write the code that take will care of the "infinite" number of values of resistors.

If you could give me an idea as to how to do so it would be greatly appreciated - on a side note, I am in C+ programming and not C++ programming, so please provide me with an answer in terms of the language I am familiar too and not one above it. Thanks.
I haven't heard the C+ language.
Did you mean C language?
 
Yes, it is the C language, however, it is not C++, but C+ instead.
 
I think the C language can't solve your problem.
( I suspect that you have some courses on "Electrical ciuruit" instead of having a programing language course).

I guess your problem can be solved by some equations by the "topology structure of the circuit" If you supply more details.
 
Well, I am currently taking Physics w/Calculus 2 and COP2220 (C programming) which is required before I transfer over to the university next year in their physics program. Therefore, I have not had any specialized courses taken yet in terms of upper-level.