Question

Quiz 13 (optional Take-home Quiz) The present quiz is concerned with making calculations on the circuit shown below which consists of i) an ideal battery with user-supplied terminal voltage Vo: and ii) a user-supplied number m of branches of resistors which are connected in series within each branch, with these branches connected in parallel across each other, and with each branch consisting of a variable user-supplied number n of resistors and user-supplied values of the resistors. NOTE: the number of resistors in a branch and their values, which are user- supplied, vary in general from branch to branch. Design two programs in C, one using the method of call by value and the other using the method of call by reference, which will perform the following computations: i) the equivalent resistance Req seen by the battery, and ii) the one-dimensional array whose elements are the currents lo, I Im-1 in the m branches. SAMPLE OUTPUT: For sample output, use the following values for the circuit elements: m 3 (three resistor branches) (no 4, i.e., 4 resistors) R00000l-10.0, RI0001]-14.5, RI0002) 25.5, Roll3)-50.00 RIiljoj 20.0, RL1][1l 50.5, RI1][2] 29.5 (n1 3, i.e., 3 resistors) (n2-2, i.e., 2 resistors) R12lloj 15.4, R12][1] 34.6 Vo 25V All resistor values in ohms RIJU m Reg.

0 0
Add a comment Improve this question Transcribed image text
Answer #1

I have developed the C program which deals with the equivalent resistance over the battery. I have added the comments for each part of the code along with the final output of the program.

Let me explain you in more simpler and step-by-step procedure:-

A)

Step-1:

The equivalance resistance can be calculated in ohm's only.

Program Code:-


// This is the header files in C for embedding the methods and properties of each class

#include<stdio.h>

// The main() method is the starting point of the program

int main() {
  
  
   // Declare the different variables
  
int resitVal[10], No, reisObj, equiResisValue = 0;

printf("Please enter the number of Resistances you want : ");
scanf("%d", &No);

printf("\nPlease enter the value of each Resistance that you want the equivalent resistance : n");

// The for loop uses the for different resistors overall

for (reisObj = 0; reisObj < No; reisObj++) {
printf("\n R%d : ", reisObj + 1);
scanf("%d", &resitVal[reisObj]);
}

for (reisObj = 0; reisObj < No; reisObj++) {
equiResisValue = equiResisValue + resitVal[reisObj];
}

// Prints the resistance value in ohms

printf("\n The equivalent resistance in terms of ohms is : %d ohms", equiResisValue);
return (0);
}

Output:-

Console View Applet View Log View Please enter the number of Resistances you want 4 Please enter the value of each ResistanceB)

One Dimensional Array Program:-


// This is the header files in C for embedding the methods and properties of each class

#include<iostream>
#include<array>
#include<windows.h>
#include<stdio.h>
using namespace std;

void Resistance1DArray(int*, int*, int*);

// The main() method is the starting point of the program

int main()
{
   // Declare the different variables
  
array<int, 10> resistanceVoltageVal;
int resistanceCurrentVal[10];
int equivalenceResistance[10];

printf("The one dimensional array for the Current Resistance is : &resistanceVoltageVal \n");
Resistance1DArray(resistanceCurrentVal,equivalenceResistance,resistanceVoltageVal);


}

void Resistance1DArray(int *rscr,int *eqr,int *rsv)
{
  
   // The for loop uses the for different current value
  
for (int curr=0; curr!=10; ++curr)
{
rsv[curr]=rscr[curr]*eqr[curr];
printf("%d \n", rscr[curr], eqr[curr], rsv[curr]);
}
}

Add a comment
Know the answer?
Add Answer to:
The present quiz is concerned with making calculations on the circuit shown below which consists of:...
Your Answer:

Post as a guest

Your Name:

What's your source?

Earn Coins

Coins can be redeemed for fabulous gifts.

Not the answer you're looking for? Ask your own homework help question. Our experts will answer your question WITHIN MINUTES for Free.
Similar Homework Help Questions
  • The program has to be written in C The expected output: Please make sure to use...

    The program has to be written in C The expected output: Please make sure to use two-dimensional arrays. OPTIONAL TAKE-HOME QUIZ WORTH 10 POINTS OUT OF A GRAND TOTAL OF 110 FOR THE COURSE A DC electrical circuit consists of an ideal battery with user-suppled terminal voltage VB which drives a resistive load comprised of a user-supplied number m of branches connected in parallel across each other, with each branch consisting of a variable user-supplied number n of resistors and...

  • The circuit shown in the figure below contains three resistors (R1, R2, and Rg) and three...

    The circuit shown in the figure below contains three resistors (R1, R2, and Rg) and three batteries (VA. Vg, and V). The resistor values are: Rq=2 Ohms, R=R3-6 Ohms, and the battery voltages are VA-25V. V8-15V, and Vc-20 V. When the circuit is connected, what will be the power dissipated by R2? Vc R R. RE O 1.0W O 2.0 O 50W 6.0 W 0 7.5 W Question 9 5 pts

  • The circuit shown in the figure below contains three resistors (Ry, Ry, and R) and three...

    The circuit shown in the figure below contains three resistors (Ry, Ry, and R) and three batteries (VA. Vg, and Vc). The resistor values are: R2-2 Ohms, R2-R3-4 Ohms, and the battery voltages are VA-25V, V -15V, and Vc-20 V. When the circuit is connected what will be the current through R22 Vc R th R2 R 0.75 A 1.25 A 2.5 A 3.0 A 3.75 A

  • The circuit shown in the figure below contains three resistors (R4, Ry, and R) and three...

    The circuit shown in the figure below contains three resistors (R4, Ry, and R) and three batteries (V, Vs, and VJ. The resistor values are: Ry=2 Ohms, Ry=R3=6 Ohms, and the battery voltages are VA-25V, V, 15 V, and Vc=20 V. When the circuit is connected, what will be the power dissipated by R ? VC R R2 R3 O 10W © 20W 05.0W 06.0W 7.5 W

  • Question 8 5 pts The circuit shown in the figure below contains three resistors (R1, R2,...

    Question 8 5 pts The circuit shown in the figure below contains three resistors (R1, R2, and R3) and three batteries (VA, V8, and Vc). The resistor values are: R1=2 Ohms, R2=R3=4 Ohms, and the battery voltages are VA=25V, V8=15 V, and Vc=20 V. When the circuit is connected what will be the current through R ? VC M R VA ** VB R2 R3 O 0.75 A O 1.25 A 0 2.5 A 3.0 A 0 3.75 A

  • The circuit shown in the figure below contains three resistors (R4, R2, and Rg) and three...

    The circuit shown in the figure below contains three resistors (R4, R2, and Rg) and three batteries (VA. Vg, and V). The resistor values are: R,-2 Ohms, R-R3-4 Ohms, and the battery voltages are VA-25V, Vp-15 V, and Vc-20V. When the circuit is connected, what will be the power dissipated by Ry? Vc A R R R3 O 1.25 W O 20W O 50W O 6.25 W O 8.13 W

  • The circuit shown in the figure below contains three resistors (Ry, Ry, and R) and three...

    The circuit shown in the figure below contains three resistors (Ry, Ry, and R) and three batteries (V, V, and V). The resistor values are: R2-2 Ohms, R, Ry-8 Ohms, and the battery voltages are VA 25V, V. 15 V, and Vc 20V. When the circuit is connected, what will be the power dissipated by Ry? Vc R R2 R3 O 0.75 W O 1.25 W O 2.67 w 42 w O 5.5 W

  • The circuit shown in the figure below contains three resistors (R1, R2, and R) and three...

    The circuit shown in the figure below contains three resistors (R1, R2, and R) and three batteries and V. The resistor values are: Ry-2 Ohms, Ry-Ry 4 Ohms, and the battery voltages are VA-25V, V -15V, and Vc-20 V. When the circuit is connected, what will be the power dissipated by Ry? VC R VA V. R2 R O 1.25 W O 2.0w O 5.0 W O 6.25 W O 8.13 W L

  • The circuit shown in the figure below contains three resistors (R1, R2, and Rg) and three...

    The circuit shown in the figure below contains three resistors (R1, R2, and Rg) and three batteries (VA, Ve, and V). The resistor values are: R=2 Ohms, R2=R3=4 Ohms, and the battery voltages are VA-25V, V =15 V, and Vc 20 V. When the circuit is connected, what will be the power dissipated by Ry? Vc R1 - Ve R₂ R O 1.25 W O 20w O 12.5 W O 6.25 W 8.13 W

  • The circuit shown in the figure below is connected for 1.70 min. (Assume R, = 7.30...

    The circuit shown in the figure below is connected for 1.70 min. (Assume R, = 7.30 2, R2 = 2.10 2, and V = 16.0 V.) 35.00 W 3.00 12 R $1.0022 + 4.00 V (a) Determine the current in each branch of the circuit. branch magnitude (A) direction left branch ---Select--- middle branch ---Select--- right branch ---Select-- (b) Find the energy delivered by each battery. 4.00 v battery 16.0 V battery (c) Find the energy delivered to each resistor....

ADVERTISEMENT
Free Homework Help App
Download From Google Play
Scan Your Homework
to Get Instant Free Answers
Need Online Homework Help?
Ask a Question
Get Answers For Free
Most questions answered within 3 hours.
ADVERTISEMENT
ADVERTISEMENT
ADVERTISEMENT