Answered step by step
Verified Expert Solution
Question
1 Approved Answer
This is a java lab question2.4. Please help me to get the answer ASAP. Implement the class Security Agent described below. Instance variables. A security
This is a java lab question2.4. Please help me to get the answer ASAP.
Implement the class Security Agent described below. Instance variables. A security agent is responsible for a particular door lock. Declare the necessary instance variables such that a SecurityAgent: I Remembers (stores) a Combination II Has access to this particular DoorLock, i.e. maintains a reference to a Door Lock object Implement a constructor with no parameter such that when a new Security Agent is created: I It creates a new Combination and stores it II It creates a new DoorLock with this saved Combination. For the sake of simplicity, you may decide to always use the same combination If secret is the name of the instance variable that is used to remember the Combination. Or, you can let your SecurityAgents use their imagination, so that each SecurityAgent has a new Combination that it only knows. Valid values must be in the range 1 to 10; Alternative way to generate a random combination Implement the instance method public DoorLock getDoorLock() that returns a reference to the saved DoorLock Implement the instance method public void enableDoorLock() that simply re-enable the particular DoorLock that this SecurityAgent is responsible for, with the saved secret CombinationStep by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started