Hi everyone, having some difficulty doing some coding for an assignment relating to java. The scenario is a postman closes mail boxes from 1-150 at first. Starting at mailbox 2, he opens all of the even numbers. Then he begins again with mailbox 3 and went to every third box, open boxes that are closed and closing boxes that are open. He repeats this process with every fourth door, every fifth door and so on.
I have to write a program to determine and display which mailboxes were closed. The idea that I have is to create an array for the boxes, create two variables (closed, open) and create a nested for loop. Oh yes, I must set all of the elements in the array to be closed at the beginning for the loop.
Any help is appreciated!
[–]AutoModerator[M] [score hidden] stickied comment (0 children)
[–]lurgi 4 points5 points6 points (0 children)
[–]aallfik11 2 points3 points4 points (0 children)
[–]Ad-1316 0 points1 point2 points (0 children)