class HomeSecuritySystem { private int accessCode; // code that must be entered to open the door. private final int NUM_ERRORS_BEFORE_COPS_CALLED = 3; /** * Constructor for security system; sets the code to a specified value. */ public HomeSecuritySystem(int newCode) { accessCode = newCode; } /** * Attempts to open the door. If the entered code matches the * stored code, the door opens. Otherwise, the police get called. */ public void openDoor(int enteredCode) { if (enteredCode == accessCode) { System.out.println("The door is open."); } else { System.out.println("The police have been called."); } } }