myoreorex
asked on
No one will get this one!!!
3 Write a program to solve the following problem. Use an array to model the
safety deposit box vault. Initialize the boxes as described below.
==========================
SAFETY DEPOSIT BOXES
==========================
There has been a run at the local savings and loan. One thousand depositors
have lined up in a very long vault with 1000 _CLOSED_ safety deposit boxes.
One by one the depositors run through the vault. The first depositor opens
every box. The second depositor goes to every second box and closes it.
The third depositor goes to every third box and changes it (if open, closes
it; if closed, open it). In a similiar manner, every fourth, fifth, sixth,
... depositor changes every fourth, fifth, sixth, ... box. After all 1000
depositors have passed through the vault, which boxes are left open?
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
Thanks...I forgot about the foreach!!!
michelle
michelle
ASKER
Michelle