Answer:

Design of the Lock

combination 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, with the combination "6-12-30"

  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?