Professional Documents
Culture Documents
Untitled
Untitled
namespace SafeLockExample
{
class SafeLock
{
private bool _locked;
private int _password;
private int _maxAttempts;
private int _remainingAttempts;
The maximum number of attempts to unlock the lock can be specified in the
constructor.
After a certain number of incorrect attempts, the lock automatically re-locks
itself.
The number of remaining attempts is displayed after each unsuccessful attempt.
The Locked property is read-only and can be used to check if the lock is currently
locked.