subject

Aschool has 100 lockers and 100 students. all lockers are closed on the first day of school. as the students enter, the first student, denoted s1, opens every locker. then the second student, s2, begins with the second locker, denoted l2, and closes every other locker. student s3 begins with the third locker and changes every third locker (closes it if it was open, and opens it if it was closed). student s4 begins with locker l4 and changes every fourth locker. student s5 starts with l5 and changes every fifth locker, and so on, until student s100 changes l100. after all the students have passed through the building and changed the lockers, which lockers are open? write a program to find your answer. the program should display the answer like this: locker x is open locker y is open locker z is open design requirement: use a method and an array of 100 boolean elements, each of which indicates whether a locker is open (true) or closed (false). initially, all lockers are closed.

ansver
Answers: 3

Another question on Computers and Technology

question
Computers and Technology, 21.06.2019 22:00
What do the principles of notice, choice, onward transfer, and access closely apply to? a. privacyb. identificationc. retentiond. classification
Answers: 1
question
Computers and Technology, 22.06.2019 17:30
1. before plugging in a new device to a computer you should unplug all other devices turn off the computer turn on the computer 2. many of the maintenance tools for a computer can be found in the control panel under administrative tools display personalization
Answers: 1
question
Computers and Technology, 22.06.2019 20:00
Which type of file can be used to import data into a spreadsheet?
Answers: 1
question
Computers and Technology, 23.06.2019 21:50
Description: write function lastfirst() that takes one argument—a list of strings of the format "lastname, firstname" —and returns a list consisting of two lists: (a) a list of all the last names (b) a list of all the first names
Answers: 2
You know the right answer?
Aschool has 100 lockers and 100 students. all lockers are closed on the first day of school. as the...
Questions
question
Mathematics, 19.05.2020 22:11
question
Mathematics, 19.05.2020 22:11
question
Mathematics, 19.05.2020 22:11
question
Mathematics, 19.05.2020 22:11
question
Mathematics, 19.05.2020 22:11
Questions on the website: 13722363