Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Write a complete C++ program that implements the following: Part I Create an ASCII Art representation of a simple parallel circuit using cout and proper

Write a complete C++ program that implements the following:

Part I

Create an ASCII Art representation of a simple parallel circuit using cout and proper formatting statements, similar to the circuit shown below, with the following components:

Supply Voltage (VS) = 12 VDC, R1, R2, R3

Part II

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:

Select from the following circuit types:

Three-resistors Parallel Circuit

Three-resistors Series Circuit

Quit Program

Enter Your Choice: 1

Three-resistors Parallel Circuit Selected

Enter value for R1 in Ohms: 4700

Enter value for R2 in Ohms: 6800

Enter value for R3 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 R3 = 1.463 mA

Total Source Current = 5.781 mA

Total power = 69.372 mW

Equivalent Resistance = 2075.765 Ohms

------------------------------------------------

Would you like to do another circuit analysis? (Y/N):

=============================================================

Formulas and steps to analyze the parallel or series circuits

Parallel Circuit

Step 1 RT = 1 / ( (1/R1) + (1/R2) + (1/R3) ); //Parallel circuit Equivalent Resistance

Step 2 IS = VS RT;

Step 3 VR1 = VR2 = VR3 = VS;

Step 4 IR1 = VS / R1;

Step 5 IR2 = VS / R2;

Step 6 IR3 = VS / R3;

Step 7 PT = VS * IS;

Series Circuit

Step 1 RT = R1 + R2 + R3; //Series circuit Equivalent Resistance

Step 2 IS = VS / RT;

Step 3 IR1 = IR2 = IR3 = IS;

Step 4 VR1 = IS * R1;

Step 5 VR2 = IS * R2;

Step 6 VR3 = IS * R3;

Step 7 PT = VS * IS;

Please make sure to include series calculations as well, thank you.

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

More Books

Students also viewed these Databases questions