{[ promptMessage ]}

Bookmark it

{[ promptMessage ]}

homework5-godara - Tanuj Godara 9052-79307 Problem Solving...

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

View Full Document Right Arrow Icon
Tanuj Godara 9052-79307 Problem Solving with C++ Due date: 2/21/10 by 11:55PM This assignment is to be done individually Work these exercises at home. 1. Do problem 9 on page 129. #include <iostream> #include <cmath> #include <iomanip> using namespace std; void main() { double resistor1; double resistor2; double resistor3; double combined; cout << "Enter the Resistance in Ohms of your three resistors: " << endl; cin >> resistor1; cin >> resistor2; cin >> resistor3; combined = (1/((1/resistor1)+(1/resistor2)+(1/resistor3))); cout << "The Combined resistance is: " << setw(7) << fixed << setprecision(2) << combined << " Ohms." << endl; } 2. Repeat problem 1 above using resistance values for R 1 = 10, 100, 1000, 10000, 10000. Describe the difference in the overall combined resistance as R 1 increases. The overall resistance increases as R1 increases. R1 R2 R3 Total 10 1000 1000 9.80 100 1000 1000 83.33 1000 1000 1000 333.33 10000 1000 1000 476.19 100000 1000 1000 497.51 3. Do problem 9 on page 172 using the following values. Be sure to use a nested looping structure to incorporate all of the data values requested.
Background image of page 1

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

View Full Document Right Arrow Icon
Image of page 2
This is the end of the preview. Sign up to access the rest of the document.

{[ snackBarMessage ]}