Question: Write a program that uses Ohms law (V = I * R, where V is the voltage in volts, I is the current in amps,
Write a program that uses Ohms law (V = I * R, where V is the voltage in volts, I is the current in amps, and R is the resistance in Ohms) to solve a basic 3-resistors parallel or series circuit problem with a fixed DC voltage source rated at 12 VDC. First, your program should display a brief description of its operation and then ask the user to choose either a single source 3-resistors series circuit or a parallel circuit with the same specs. Next, program prompts the user for the resistance values R1, R2, R3 and then computes and displays the voltage values across these resistors, the currents through each, and the total current supplied by the voltage source. Finally, program will calculate the total power supplied by the voltage source using the P = V * I, and the equivalent resistance as seen by the voltage source. You should use cout and cin for the output and input, respectively. Display the results in floating point format with a field width of 10 characters, three decimal point digits, and right-justified. Use a while and switch structure to analyze each circuit based on that circuits component values. Within the switch, prompt the user to enter the appropriate data your program needs to calculate the voltages, currents, and total power based on that circuit resistor values. Sample Output:
Due Date: September 23, 2018
Enter Your Choice: 1 Three-resistors Parallel Circuit Selected Enter value for R1 in Ohms: 4700 Enter value for R1 in Ohms: 6800 Enter value for R1 in Ohms: 8200 ------------------------------------------------ Voltage across R1 = 12 VDC Voltage across R2 = 12 VDC Voltage across R3 = 12 VDC Current through R1 = 2.553 mA Current through R2 = 1.765 mA Current through R1 = 1.463 mA Total power = 69.372 mW Equivalent Resistance = 2075.765 ------------------------------------------------ Would you like to do another circuit analysis? (Y/N):
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
