Question: Please edit this code so it is separated into methods, the output in its own method and prompt for the number of lockers too instead
Please edit this code so it is separated into methods, the output in its own method and prompt for the number of lockers too instead of just it just being
public class LockerPuzzle
public static void mainString args
boolean lock new boolean;
for int i ; i lock.length; i
locki false;
for int i ; i lock.length; i
for int j i; j lock.length; j
if ji
lockjlockj;
if locki true
System.out.printlnLocker i is open.";
Step by Step Solution
There are 3 Steps involved in it
1 Expert Approved Answer
Step: 1 Unlock
Question Has Been Solved by an Expert!
Get step-by-step solutions from verified subject matter experts
Step: 2 Unlock
Step: 3 Unlock
