Question: p Question 3 Defining a class Combination locks found on padlocks, lockers, or safes may use a single dial which interacts with several parallel discs


p
Question 3 Defining a class "Combination locks found on padlocks, lockers, or safes may use a single dial which interacts with several parallel discs or cams. Customarily, a lock of this N 02 type is opened by rotating the dial clockwise to the first numeral, counter clockwise to the second, and so on in an alternating fashion until the last numeral is reached. The cams typically have an indentation or notch, and llsho com/ when the correct combination is entered, the notches align, allowing the latch ombination-lock to fit into them and open the lock. (https en wikipedia or wiki/ Combination lock#Single-dia ocks) a) Create a class named CombinationLock that stores information about a 3-number dialing combination lock. It contain the following: Four private instance variables that store the 3 combination numbers required to open the lock and a Boolean variable that will indicate whether the lock is open or closed (true if open, false if closed) constructors: cts/c
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
