A good answer might be:

  • How many numbers does the combination lock on your gym locker use?
    • Three.
  • When you dial the combination, does the order of the numbers matter?
    • Yes.
  • What is your combination?
    • 6-12-30
  • Is there anything in your locker I can use?
    • What would a computer nerd need with gym equipment?

Design of the Lock

A typical combination lock will open only after its dial has been moved to the three numbers of the combination in the correct order. For example, the combination "6-12-30" would be used by:

  1. Move the dial clockwise two rotations.
  2. Move the dial clockwise to "6"
  3. Move the dial counterclockwise to "12"
  4. Move the dial clockwise to "30"
  5. Pull the lock open.
In the progam we will ignore the details of rotation. The lock will open when the user has entered the correct three numbers in sequence.

QUESTION 2:

After you have entered a number does the lock immediately tell you if it is wrong number?

Click Here after you have answered the question