{[ promptMessage ]}

Bookmark it

{[ promptMessage ]}

homework_8

# homework_8 - ECE 1574 Homework Set#8 Problem Solving with C...

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

ECE 1574 Homework Set #8 Problem Solving with C++ Due date: 3/21/10 by 11:55 p.m. This assignment is to be done individually Complete the lab 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 Resistance_Addition.cpp. Expose these functions in your program’s main . cpp file by an

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

View Full Document
appropriate #include and use them there wherever parallel or series addition of resistances is needed. 4. Give 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
This is the end of the preview. Sign up to access the rest of the document.

{[ snackBarMessage ]}

### Page1 / 6

homework_8 - ECE 1574 Homework Set#8 Problem Solving with C...

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

View Full Document
Ask a homework question - tutors are online