EEE1008 2012/13: Project 4. Equivalent Resistance Calculations

Consider the electrical circuit shown in the figure below:

Ladder Network


Such circuits are often called Ladder Networks.

This circuit contains 2n resistors connected in a ``series-parallel'' way. Every resistor whose number is odd (i.e., 1,3, ..., 2n-1) is connected in series with the group of resistors whose numbers are greater than its number. Those resistors whose numbers are even (i.e., 2,4, ..., 2n) are connected in parallel with the group of resistors whose numbers are greater. For example, R(1) is in series with the group between points (a) and (b), that is consisting of R(2),R(3), ..., R(2n). On the other hand, R(2) is in parallel with the group of resistors between points (a) and (c), that is R(3),R(4), ..., R(2n). Only the last two resistors, R(2n-1) and R(2n) are connected in series.

Design, implement and document a program that should perform the following:
Note: To read input from a file (instead of from the keyboard) enter the data into a file (called, say, data.txt), and then enter the command
./a.exe < data.txt
(assuming your compiled program is called a.exe). This is called I/O redirection, and saves you from typing all the input every time you run the program. You can then use scanf in the normal manner.


Submission: You should submit a single pdf file on Blackboard. Your submission should have the following structure:
  • Objective. What is the program meant to achieve?
  • Pseudocode description of parts 1 and 2
  • Testing results: what values and choices did you use to test the program, and whether the results were correct
  • Conclusion: did the program work? If not, why? How could it be improved?
  • The program listing, including comments. Code will be marked according to whether you have done extensive validation, whether functions, arrays and variables have been used properly, and whether the program layout is appropriate.
  • Example outputs, corresponding to your testing strategy