The lab door sealed itself behind you, and the vault runs on Java arithmetic. Five locks. Each one you open reveals one digit of the escape code. Solve honestly — the vault can tell when a code wasn't earned.
🔒LOCK 1 · The Truncation Cell— both are intsLOCKED
System.out.println(18 / 5);
What prints?
The lock clicks open. First digit: 3
🔒LOCK 2 · The Remainder WheelLOCKED
System.out.println(17 % 5);
What prints?
The wheel spins free. Second digit: 2
🔒LOCK 3 · The Sweep— two passes, both left to rightLOCKED
System.out.println(2 + 3 * 4 - 20 / 4);
What prints?
The sweep completes. Third digit: 9
🔒LOCK 4 · The Parentheses CageLOCKED
System.out.println((2 + 3) * 4 % 6);
What prints?
The cage swings open. Fourth digit: 2
🔒LOCK 5 · The Zero ChamberLOCKED
System.out.println(10 / 0);
What happens when this line runs?
The chamber powers down. Final digit — the one number you can never divide by: 0
🔑 THE VAULT DOOR
Enter the five digits, in lock order.
🔓 VAULT OPEN — YOU ESCAPED IN ! Show Mr. Babb your screen. You just proved: truncation, remainders, the two-pass sweep, parentheses, and the zero rule.
Mr. Babb · AP Computer Science A · Paul Public Charter School