Answered step by step
Verified Expert Solution
Link Copied!

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

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Spatial Databases With Application To GIS

Authors: Philippe Rigaux, Michel Scholl, Agnès Voisard

1st Edition

1558605886, 978-1558605886

More Books

Students also viewed these Databases questions