Solved

If/Else Simulation
for Each Call Below to the Following Method

Question 5

Essay

If/Else Simulation
For each call below to the following method, write the output that is produced, as it would appear on the console:
public static void ifElseMystery(int a, int b, int c) {
if (a < b && a < c) {
a = a + c;
c++;
} else if (a >= b) {
a = a - b;
b--;
}
if (a >= b && a >= c) {
a++;
c++;
}
System.out.println(a + " " + b + " " + c);
}
 Method Call  Output  ifelsemystery (2,10,3)       iftlsemystery (8,6,1)       iftlsemystery (4,6,7)       ifelsemystery (20,5,5)      \begin{array}{l}\underline{ \text { Method Call } }& \underline{ \text { Output }} \\\text { ifelsemystery }(2,10,3) \text {; } & \underline{ \text { }} \underline{ \text { }} \underline{ \text { }} \underline{ \text { }} \underline{ \text { }} \underline{ \text { }} \\\text { iftlsemystery }(8,6,1) \text {; } & \underline{ \text { }} \underline{ \text { }} \underline{ \text { }} \underline{ \text { }} \underline{ \text { }} \underline{ \text { }}\\\text { iftlsemystery }(4,6,7) \text {; } & \underline{ \text { }} \underline{ \text { }} \underline{ \text { }} \underline{ \text { }} \underline{ \text { }} \underline{ \text { }}\\\text { ifelsemystery }(20,5,5) \text {; } & \underline{ \text { }} \underline{ \text { }} \underline{ \text { }} \underline{ \text { }} \underline{ \text { }} \underline{ \text { }} \end{array}

Correct Answer:

verifed

Verified

Unlock this answer now
Get Access to more Verified Answers free of charge

Related Questions