Question
Part B: Use the knowledge gained in part A to implement a series network that has unlimited number of resistors stored in a C++ vector.
Part B:
Use the knowledge gained in part A to implement a series network that has unlimited number of resistors stored in a C++ vector. In general, to solve this problem you will do the following:
Prompt for the input voltage
Input the resistor values and store them in a vector.
Solve for series current
Calculate total circuit power
Calculate the voltage drop across each resistor
Calculate the power dissipated by each resistor.
Display results.
Most of the above bullet points could/should become individual functions to solve this problem.
Please test your functions with a variety of inputs in main().
Please see sample output at the end of this document for suggestions.
Note:
To determine the series current you will first need to add up all the series resistors (Rtotal). Once you have Rtotal the current simply becomes:
Series Current = Voltage Source / Rtotal
You can use this Current to determine the power dissipation and voltage drops across the individual resistors.
Part B:
Sample 1:
Enter Voltage: 100
Enter Resistance (0 to exit): 100
Enter Resistance (0 to exit): 0
Circuit Parameters:
Total Resistance: 100 ohms
Input Voltage: 100 volts
Series Current: 1 Amp
Total Power: 100 Watts
Node 0 Parameters:
Resistance: 100 ohms
Voltage: 100 volts
Power: 100 Watts
Sample 2:
Enter Voltage: 100
Enter Resistance (0 to exit): 50
Enter Resistance (0 to exit): 50
Enter Resistance (0 to exit): 0
Circuit Parameters:
Total Resistance: 100 ohms
Input Voltage: 100 volts
Series Current: 1 Amp
Total Power: 100 Watts
Node 0 Parameters:
Resistance: 50 ohms
Voltage: 50 volts
Power: 50 Watts
Node 1 Parameters:
Resistance: 50 ohms
Voltage: 50 volts
Power: 50 Watts
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started