If/Else Simulation
Category: Simulation
Author: Stuart Reges
Book Chapter: 4.1
Problem: If/Else Simulation
Consider the following method. public static void ifElseMystery(int a, int b) { if (a < b) { a++; } if (a < b) { a++; } else { b++; } if (a >= b) { b = b - 5; } System.out.println(a + " " + b); } For each call below, indicate what output is produced.
1) ifElseMystery(1, 8);
2) ifElseMystery(3, 5);
3) ifElseMystery(4, 5);
4) ifElseMystery(8, 6);