
That isn't automatic in C/C++, but.I would need to know what version of C++ you're targeting (C++11, C++14, C++17?). What I don't see is the principal's pass.where he closes all of the lockers (which I assume is to ensure all bool's in the locker array are set to false). I see a call to "toggleLockers", but I don't find the function body. Setting that aside, what you have is a loop for every locker. Void displayLockers( int numLockers, bool lockers) is probably an accidental shift-key typo. * lockers after each student passes through the hallway.


* Write a program to display the status of the Do you get the idea? The fifth student starts at locker number five and changes every fifth locker, and so on until the nth student only changes the nth locker.Īfter all the students have passed through the building and changed the lockers, which lockers are open and which are closed? Write a program to display the status of the lockers after each student passes through the hallway. The fourth student begins with the fourth locker and changes every fourth locker. The third student begins with the third locker and changes every third locker (closes it if it was open, and opens it if it was closed). The second student closes every other locker, shutting the door on lockers 2 and 4 and 6, etc. The first student to enter the hallway opens every locker. That's what this program will be simulating.īefore the school opens, the principal has closed each locker. Now imagine a single student walking down the hallway and opening or closing the lockers. Continued abuse of our services will cause your IP address to be blocked indefinitely.Imagine a high school hallway with n lockers and n students. Please fill out the CAPTCHA below and then click the button to indicate that you agree to these terms. If you wish to be unblocked, you must agree that you will take immediate steps to rectify this issue. If you do not understand what is causing this behavior, please contact us here. If you promise to stop (by clicking the Agree button below), we'll unblock your connection for now, but we will immediately re-block it if we detect additional bad behavior. Overusing our search engine with a very large number of searches in a very short amount of time.Using a badly configured (or badly written) browser add-on for blocking content.Running a "scraper" or "downloader" program that either does not identify itself or uses fake headers to elude detection.Using a script or add-on that scans GameFAQs for box and screen images (such as an emulator front-end), while overloading our search engine.There is no official GameFAQs app, and we do not support nor have any contact with the makers of these unofficial apps. Continued use of these apps may cause your IP to be blocked indefinitely.

This triggers our anti-spambot measures, which are designed to stop automated systems from flooding the site with traffic.
