Question: 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 theThis 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 Combination

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!