Answered step by step
Verified Expert Solution
Question
1 Approved Answer
please make pseudocode,flowchart uml class diagram thank you public class LockerPuzzle { public static void main(String[] args){ boolean lock[] = new boolean[101]; for (int i
please make pseudocode,flowchart uml class diagram thank you
public class LockerPuzzle {
public static void main(String[] args){
boolean lock[] = new boolean[101];
for (int i = 1; i < lock.length; i++){
lock[i]=false;
}
for (int i = 1; i < lock.length; i++){
for (int j = i; j < lock.length;j++){
if ((j) % (i) == 0){
lock[j] = !lock[j];
}
}
// Display open lockers
if (lock[i] ==true){
System.out.println("Locker " + i + " is open.");
}
}
}
}
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started