\(A. For which of the following inputs of x, y, and z (in that order) will y be the same value at the completion of the flowchart as it was at the beginning?\)
A. 5, -2, -5
X>Y Yes (Swap) = -2,5,-5
Y>Z Yes (Swap) = -2,-5,5
X>Y Yes (Swap) = -5,-2,5
Y Value is same in last as it was in beginning.B. -1, 0, -3
X>Y No = -1, 0, -3
Y>Z Yes (Swap) = -1, -3, 0
X>Y Yes (Swap) = -3, -1, 0
Y Value is not same in last as it was in beginning. (Wrong)
C. 3, 5, 1
X>Y No = 3, 5, 1
Y>Z Yes (Swap) = 3, 1, 5
X>Y Yes (Swap) = 1, 3, 5
Y Value is not same in last as it was in beginning.(wrong)
Answer is A
\(B. For which of the following inputs of x, y, and z (in that order) will z = 3x at the end of the flowchart?\)
A. 2, 1, 6
X>Y Yes (Swap) = 1, 2, 6
Y>Z No = 1, 2, 6
X>Y No = 1, 2, 6
Putting value in Z=3X
6 ≠ 3(1) {Wrong}
B. -3, -1, -9
X>Y No = -3, -1, -9
Y>Z Yes (Swap) = -3, -9, -1
X>Y Yes (Swap) = -9, -3, -1
Putting value in Z=3X
-1 ≠ 3(-9) {Wrong}
C. 6, 2, 5
X>Y Yes (Swap) = 2, 6, 5
Y>Z Yes (Swap) = 2, 5, 6
X>Y No = 2, 5, 6
Putting value in Z=3X
6 = 3(2) {Right}Answer is C
Posted from my mobile device