about | help | code help+videos | done | prefs |
tmhscs@gmail.com lockers
LLLLLLLLLLL kkkkkkkk
L:::::::::L k::::::k
L:::::::::L k::::::k
LL:::::::LL k::::::k
L:::::L ooooooooooo cccccccccccccccc k:::::k kkkkkkk eeeeeeeeeeee rrrrr rrrrrrrrr ssssssssss
L:::::L oo:::::::::::oo cc:::::::::::::::c k:::::k k:::::k ee::::::::::::ee r::::rrr:::::::::r ss::::::::::s
L:::::L o:::::::::::::::o c:::::::::::::::::c k:::::k k:::::k e::::::eeeee:::::eer:::::::::::::::::r ss:::::::::::::s
L:::::L o:::::ooooo:::::oc:::::::cccccc:::::c k:::::k k:::::k e::::::e e:::::err::::::rrrrr::::::rs::::::ssss:::::s
L:::::L o::::o o::::oc::::::c ccccccc k::::::k:::::k e:::::::eeeee::::::e r:::::r r:::::r s:::::s ssssss
L:::::L o::::o o::::oc:::::c k:::::::::::k e:::::::::::::::::e r:::::r rrrrrrr s::::::s
L:::::L o::::o o::::oc:::::c k:::::::::::k e::::::eeeeeeeeeee r:::::r s::::::s
L:::::L LLLLLLo::::o o::::oc::::::c ccccccc k::::::k:::::k e:::::::e r:::::r ssssss s:::::s
LL:::::::LLLLLLLLL:::::Lo:::::ooooo:::::oc:::::::cccccc:::::ck::::::k k:::::k e::::::::e r:::::r s:::::ssss::::::s
L::::::::::::::::::::::Lo:::::::::::::::o c:::::::::::::::::ck::::::k k:::::k e::::::::eeeeeeee r:::::r s::::::::::::::s
L::::::::::::::::::::::L oo:::::::::::oo cc:::::::::::::::ck::::::k k:::::k ee:::::::::::::e r:::::r s:::::::::::ss
LLLLLLLLLLLLLLLLLLLLLLLL ooooooooooo cccccccccccccccckkkkkkkk kkkkkkk eeeeeeeeeeeeee rrrrrrr sssssssssss
1111111 000000000 000000000
1::::::1 00:::::::::00 00:::::::::00
1:::::::1 00:::::::::::::00 00:::::::::::::00
111:::::1 0:::::::000:::::::00:::::::000:::::::0
1::::1 0::::::0 0::::::00::::::0 0::::::0
1::::1 0:::::0 0:::::00:::::0 0:::::0
1::::1 0:::::0 0:::::00:::::0 0:::::0
1::::l 0:::::0 000 0:::::00:::::0 000 0:::::0
1::::l 0:::::0 000 0:::::00:::::0 000 0:::::0
1::::l 0:::::0 0:::::00:::::0 0:::::0
1::::l 0:::::0 0:::::00:::::0 0:::::0
1::::l 0::::::0 0::::::00::::::0 0::::::0
111::::::1110:::::::000:::::::00:::::::000:::::::0
1::::::::::1 00:::::::::::::00 00:::::::::::::00
1::::::::::1 00:::::::::00 00:::::::::00
111111111111 000000000 000000000
This is a small programming project to solve a very interesting mathematical puzzle. The puzzle is described below:
Imagine 100 lockers numbered 1 to 100 in a hallway with 100 students lined up at the end of the hall:
At the start all the lockers are closed.
The first student starts at the first locker opens it, then procedes to open every locker.
The second student starts at the second locker, closes it, then closes every second locker.
The 3rd student starts at the third locker, if the locker is closed, they open it, and if it is open, they close it. They continue to invert the state of every 3rd locker.
The 4th student starts at the 4th locker and changes every fourth locker.
The 5th student starts at the 5th locker and changes every fifth locker.
That same pattern continues for all 100 students.
Here’s the question: “Which lockers are left open after all 100 students have walked the row of lockers?”
A few videos if you are confused about the problem:
https://youtu.be/c18GjbnZXMw
https://youtu.be/WdL1EBNZvQ4
Once you feel like you understand the problem you may begin:
arrayProjects_lockers H
/*We hope you enjoy both the problem and coding the solution.
- Mr. Monroe & Mr. Guidry
System.exit(0);
*/
Authoring docs
Copyright Nick Parlante 2017 - privacy