Evaluate each of the following C++ expressions. (a) i1 + (i2 * i3) (b) i1 * (i2 + i3) (c) i1 / (i2 + i3) (d) i1 / i2 + i3 (e) 3 + 4 + 5 / 3 (f) (3 + 4 + 5) / 3 (g) d1 + (d2 * d3) (h) d1 + d2 * d3 (i) d1 / d2 - d3 (j) d1 / (d2 - d3) (k) d1 + d2 + d3 / 3 (l) (d1 + d2 + d3) / 3 (m) d1 + d2 + (d3 / 3) (n) 3 * (d1 + d2) * (d1 - d3)
Solution:
For the evaluation of expressions you didn't provide the values for variables like i1, i2, i3 etc. So I am assuming the values and evaluating expressions using them. Evaluation of these expressions is based on the precedence and associativity of the operators.
Let
int i1 = 2, i2 = 5, i3 = -3;
double d1 = 2.0, d2 = 5.0, d3 = -0.5;
Now come to the question,
(a) i1 + (i2 * i3) = -13
2 + (5 * -3) = 2 - 15 = -13
(b) i1 * (i2 + i3) = 4
2 * (5 + -3) = 2 * 2 = 4
(c) i1 / (i2 + i3) = 1
2 / (5 + -3) = 2 / 2 = 1
(d) i1 / i2 + i3 = -3
2 / 5 + -3 = 0 + -3 = -3 (fraction part .4 in 2 / 5 (that is 2 / 5 = 0.4) will be truncated because operation is performed on int datatype so 2 / 5 yields 0)
(e) 3 + 4 + 5 / 3 = 8
3 + 4 + 1 = 8 (fraction part will be truncated because operation is performed on int datatype. 5 / 3 yields 1)
(f) (3 + 4 + 5) / 3 = 4
(3 + 4 + 5) / 3 = 12 / 3 = 4
(g) d1 + (d2 * d3) = -0.5
2.0 + (5.0 * -0.5) = 2.0 - 2.5 = -0.5
(h) d1 + d2 * d3 = -0.5
2.0 + 5.0 * -0.5 = 2.0 - 2.5 = -0.5
(i) d1 / d2 - d3 = 0.9
2.0 / 5.0 - (-0.5) = 0.4 + 0.5 = 0.9
(j) d1 / (d2 - d3) = 0.363636
2.0 / (5.0 - -0.5) = 2.0 / 5.5 = 0.363636
(k) d1 + d2 + d3 / 3 = 6.83333
2.0 + 5.0 + -0.5 / 3 = 7.0 - 0.166667 = 6.83333
(l) (d1 + d2 + d3) / 3 = 2.16667
(2.0 + 5.0 + -0.5) / 3 = 2.16667
(m) d1 + d2 + (d3 / 3) = 6.83333
2.0 + 5.0 + (-0.5 / 3) = 7.0 - 0.166667 = 6.83333
(n) 3 * (d1 + d2) * (d1 - d3) = 52.5
3 * (2.0 + 5.0) * (2.0 - -0.5) = 3 * 7.0 * 2.5 = 52.5
Please give thumbsup, if you like it. Thanks.
Evaluate each of the following C++ expressions. (a) i1 + (i2 * i3) (b) i1 *...
What is the dn configuration of each of the following transition metals and ions ( _ ) Cu ( _ ) Cr ( _ ) Cu2+ ( _ ) Sc3+ ( _ ) Ti3+ ( _ ) Cu+ A. d0 B d1 , C d2 , D d3 , Ed4 , F d5 , G d6 , H d7, i d8 , J d9 , K d10
For the circuit shown in the figure below,we wish to find the
currents I1, I2, and
I3.
(a) Use Kirchhoff's rules to complete the equation for the upper
loop. (Use any variable or symbol stated above as necessary. All
currents are given in amperes. Do not enter any units.)
30 V =?
(b) Use Kirchhoff's rules to complete the equation for the lower
loop. (Use any variable or symbol stated above as necessary. All
currents are given in amperes. Do...
- A. B. C. D. E. F. G. H. I. J. K. L. M. N. O. Telecommuting - A. B. C. D. E. F. G. H. I....
I found I2. I need help finding I1 and I3. Then find the power
output of each resistor.
What is the power output of each resistor in this cirouit? Find SIT,/ 2.0012 10.00 V 3.0012 I.) Draw iss loep lli .0012 5.00 the branch, bes sae Value) 10.00 2 3) Repent for 2nd loe 4) Apply locp ruie and unicfiou nult for he
By assuming P and L calculate the moment of inertia
(I1,I2, and I3) and the maximum bending stress as it mentioned
below
THEORETICAL CALCULATION Support Reactions. If P= N and the L. is _mm: a free body diagram of entire beam is shown in Fig. 2 (a) +F;=0; -P+A,+C, =0 L/2 +M = 0; - P(1/2)+C,L=0 L/2 YU L C Region AB AO Shear and Moment Functions. A frec-body diagram of the left segment of the beam is shown in...
- A. B. C. D. E. F. G. H. I. J. K. L. M. N. O. Telecommuting - A. B. C. D. E. F. G. H. I. J. K. L. M. N. O. Change - A. B. C. D. E. F. G. H. I. J. K. L. M. N. O. Job Sharing - A. B. C. D. E. F. G. H. I. J. K. L. M. N. O. Job Redesign - A. B. C. D. E. F. G. H. I. ...
1. [2pt] Calculate the current is in the following configuration: 11-7A i2-7A i3-4A i4-8A Answer: Submit Al Answers 2. [2pt] Consider the following diagram. (Give ALL correct answers, i.e., B, AC, BCD.. 2 Et A) E1-E3-i] R1-i3 R3 B) E2-E3-i3 R3-i2 R2 c) E3-E1=-13 R3-11 RI D) E2-E1-i R1-i2 R2 E) El-E2=il Riti2 R2 F) ii-i2+i3 G)iI+i2-i3 Answer: Submit Al Answers 3. [2pt] What is the magnitude of the current through R1? DATA: R1-R2 R3- 24.0 ohm. V1 6.0 Volts...
Solve for G with respect to constants I1, I2, c1, L, c2, c3, c0,
m
Evaluate the first integral from 0 to constant A
Evaluate the second integral from constant A to constant B
Thank you!
dw dw G-LG)w wtes 4 -mw-Lw'G Solve for la im ropat to I, 5, 4,0,41, (o, m, Liw
dw dw G-LG)w wtes 4 -mw-Lw'G Solve for la im ropat to I, 5, 4,0,41, (o, m, Liw
In the current divider network represented in Fig. 3.89, calculate (a) i1 if i = 8 A and i2 = 1 A; (b) v if R1 = 100 k, R2 = 100 k, and i = 1 mA; (c) i2 if i = 20 mA, R1 = 1 , and R2 = 4 ; (d) i1 if i = 10 A, R1 = R2 = 9 ; (e) i2 if i = 10 A, R1 = 100 M, and R2...
In the current divider network represented in Fig. 3.89, calculate (a) i1 if i = 8 A and i2 = 1 A; (b) v if R1 = 100 k, R2 = 100 k, and i = 1 mA; (c) i2 if i = 20 mA, R1 = 1 , and R2 = 4 ; (d) i1 if i = 10 A, R1 = R2 = 9 ; (e) i2 if i = 10 A, R1 = 100 M, and R2...