there are errors to this java but i dont know where
import java.util.Random;
public class LOCKER{
public static void main(String[] args){
Scanner keyboard = new Scanner(System.in);
int studentVisitCount = 0;
System.out.print("Enter the number of lockers: ");
int numberOfLockers = console.nextInt();
for(int x==0 ;x<=numberOfLockers ; x++){
if(x%y==0){
studentVisitCount--;
}
for(int y=0; y<=x; y++){
if(studentVisitCount%3!=0){
System.out.print(y+" ");
}
}
}
System.out.println("The number of lockers and students are: "+numberOfLockers);
System.out.print("The locker numbers left open at the end of the game are: ");
}
}
--- Update ---
A high school has 1000 students and 1000 lockers, one locker for each student. On the first day
of school, the principal plays the following game: She asks the first student to open all the
lockers. She then asks the second student to close all the even-numbered lockers. The third
student is asked to check every third locker. If it is open, the student closes it; if it is closed, the
student opens it. The fourth student is asked to check every fourth locker. If it is open, the
student closes it; if it is closed, the student opens it. The remaining students continue this game.
In general, the nth student checks every nth locker. If it is open, the student closes it; if it is
closed, the student opens it. After all the students have taken turns, some of the lockers are
open and some are closed.
The program below, when ran, will prompt the user to enter the number of lockers in the
school. After the game is over, the program will output the number of lockers and the lockers
numbers of the lockers that are open. However, the statements are in the wrong order, and
there are some bugs in this program. Rearrange the statements and also find and remove the
bugs so that the program can run properly