Link to home
Start Free TrialLog in
Avatar of myoreorex
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
Avatar of maneshr
maneshr

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of myoreorex
myoreorex

ASKER

Thanks...I forgot about the foreach..........

Michelle
Thanks...I forgot about the foreach!!!


michelle