homework8-godara

homework8-godara - ECE 1574 Homework Set #8 Tanuj Godara...

Info iconThis preview shows pages 1–3. Sign up to view the full content.

View Full Document Right Arrow Icon
ECE 1574 Homework Set # 8 Tanuj Godara 905279307 This assignment is to be done individually Complete the l ab exercise and answer questions 1 and 2 during the lab session. Answer the other questions later. LAB EXERCISE Consider the electrical circuit shown. ------2 ohms---- ----3 ohms---- - | | | | | | | | --- ---- ---- | | | | | | | | | | | | | ------4 ohms---- ----- 5 ohms---- | | | 100 volts 10 - 20 ohms | | | | ___ ___ - - In the circuit , there are a 100 - volt DC source, a 2 - ohm resistor in parallel with a 4 - ohm resistor, and then a 3 - ohm resistor in parallel with a 5- ohm resistor. The circuit is terminated in a load whose value varies randomly logarithmically, as in last week’s lab, between 10 and 20 ohms. Run a Monte Carlo simulation, estimating the expected (that is, the average) current through each of the five resistors. REQUIREMENTS 1. Write a function called parallel_resistance() which takes two resistances as arguments and returns their combined resistance in parallel. 2. Write a function called series_resistance() which takes two resistances as arguments and returns their combined resistance in series. 3. Stage the two functions together in a namespace called Resistance_Addition, presented in a header Resistance_Addition.h and coded in a program-source file
Background image of page 1

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon
Resistance_Addition.cpp. Expose these functions in your program’s main . cpp file by an appropriate #include and use them there wherever parallel or series addition of resistances is needed. 4. G ive using statements in your . cpp files as seems advisable to you, but (a) do not give any using statements in your header ( using statements in a header are usually a bad idea, because they apply not only to the header itself but also, indiscriminately, to every program-source file in which the header is #included ) and (b) do not issue a using namespace directive anywhere in your program, for any reason (that is, don’t dump your namespaces: you may write “using std::cout;” and the like, but do not write “using namespace std;”.) 5. In your main program-source file, write a function void calculate_both_currents( double ra, double rb, double v, double *ia, double *ib ) which, given two resistors connected in parallel, calculates and stores the current each resistor carries. Present this function after main(),
Background image of page 2
Image of page 3
This is the end of the preview. Sign up to access the rest of the document.

This note was uploaded on 04/14/2010 for the course COMM 2064 taught by Professor Jimkuypers during the Spring '08 term at Virginia Tech.

Page1 / 6

homework8-godara - ECE 1574 Homework Set #8 Tanuj Godara...

This preview shows document pages 1 - 3. Sign up to view the full document.

View Full Document Right Arrow Icon
Ask a homework question - tutors are online