Question

LockADT

1.   LockADT – Show the interface and all abstract methods

LockDataStructureClass – Show the following methods: default constructor, overloaded constructor, copy constructor, setX, setY, setZ, alter (change the lock’s combination to the numbers passed) turn (use for loops to show the dial turning), close (locks the lock), attempt (tries to unlock the lock – calls turn( ), inquire (locked or unlocked), current (returns the number the dial is pointing to), toString

LockClientDemoClass – You should have a Lock object instantiated and a menu method that displays:

1: set lock combination 

2: close lock  

3: check status 

4: attempt to open lock

5: check what the dial is currently pointing at

6: exit the program

 

Example of turning the lock:

First number (17):  0 39 38 37 … 0 39 38 …17

Second number (26): 17 18 19 ... 38 39 0 1 2 … 17 18 19 20 21 22 23 24 25 26

Third number (9): 26 25 24 23 …. 12 11 10 9 (go directly to the number)

 

Demonstrate all behaviors (actions, methods) of the lock.


2 0
Add a comment Improve this question Transcribed image text
Answer #1

floot odd Cloot, floak) lang a, b, x end arg Sm

answered by: ANURANJAN SARSAM
Add a comment
Know the answer?
Add Answer to:
LockADT
Your Answer:

Post as a guest

Your Name:

What's your source?

Earn Coins

Coins can be redeemed for fabulous gifts.

Not the answer you're looking for? Ask your own homework help question. Our experts will answer your question WITHIN MINUTES for Free.
Similar Homework Help Questions
  • Lab 2 (ADTs) 1) LockADT – Show the interface and all abstract methods LockDataStructureClass – Show the following methods: default constructor, overloaded constructor, copy constructor, setX, setY, s...

    Lab 2 (ADTs) 1) LockADT – Show the interface and all abstract methods LockDataStructureClass – Show the following methods: default constructor, overloaded constructor, copy constructor, setX, setY, setZ, alter (change the lock’s combination to the numbers passed) turn (use for loops to show the dial turning), close (locks the lock), attempt (tries to unlock the lock – calls turn( ), inquire (locked or unlocked), current (returns the number the dial is pointing to), toString LockClientDemoClass – You should have a...

  • The dial on a combination lock shows the integers 0 through 39. Turning the dial to...

    The dial on a combination lock shows the integers 0 through 39. Turning the dial to three specific numbers (in order) opens the lock. a) How many different locks can a manufacturer produce before they have to reuse combinations, if numbers cannot be repeated in a combination (i.e., 25-17-25 is not allowed)? How many different locks can a manufacturer produce before they have to reuse the combination if numbers can be repeated in a combination?

  • Declare a class ComboLock that works like the combination lock in a school or gym locker.....

    Declare a class ComboLock that works like the combination lock in a school or gym locker.. The lock is constructed with a combination dial numbers between 0 and 39. The constructor sets the three "secret" numbers and the current position to 0. The reset method resets the dial so that it points to 0. The turnLeft and turnRight methods turn the dial by a given number of ticks to the left or right. The open method attempts to open the...

  • Java Help, Will definitely give a thumbs up if it works. Declare a class ComboLock that...

    Java Help, Will definitely give a thumbs up if it works. Declare a class ComboLock that works like the combination lock in a gym locker (Consult the API provided to look for the methods needed). The locker is constructed with a combination - three numbers between 0 and 39. The reset method resets the dial so that it points to 0. The turnLeft and turnRight methods turn the dial by a given number of ticks to the left or right....

  • Code in blue j. A tester class is needed. Also if you comment that will help...

    Code in blue j. A tester class is needed. Also if you comment that will help greatly. If you can help me I will give you a thumbs up. Declare a class ComboLock that works like the combination lock in a gym locker, as shown below. The lock is constructed with a combination—three numbers between 0 and 39. The reset method resets the dial so that it points to 0. The turnLeft and turnRight methods turn the dial by a...

  • Question 2 - Programming Exercise 1. Make a directory for this lab and change into it....

    Question 2 - Programming Exercise 1. Make a directory for this lab and change into it. 2. Copy files using the following command: cp/net/data/ftp/pub/class/115/ftp/cpp/Inheritance/Exercise.cpp Exercise.cpp Finish the program so that it compiles and runs. The instructions are contained in the C++ file. Your completed program should generate output similar to the following: TwoD default constructor This program asks for the coordinates of two points in 3D space and calculates their distance. Please enter the xyz coordinates for the first point:...

  • Task 1 of 3 Game Rules Presented here, is an outline of the rules of the...

    Task 1 of 3 Game Rules Presented here, is an outline of the rules of the game around which this assignment is centred. This is not meant to be a completely exhaustive explanation, as you should defer to the specics provided in the Task descriptions for more detail, but rather this is to esh out the design and intention behind the game. 2.1.1 Game Board The game is played on a square board made of NxN characters where N is...

  • Using the database created in W1 Assignment, convert each subject's age and height into a z-score....

    Using the database created in W1 Assignment, convert each subject's age and height into a z-score. Using the z-score of ±1.645 for the 5 percent cutoff and the z-score of ±1.96 for the 2.5 percent in the tail, identify the subject identification (ID) number for subjects who are closest to the cutoff for the upper 2.5 percent and 5 percent of the scores and the lower 2.5 percent and 5 percent of the scores. Do this by comparing each participant’s...

  • We assume that our wages will increase as we gain experience and become more valuable to...

    We assume that our wages will increase as we gain experience and become more valuable to our employers. Wages also increase because of inflation. By examining a sample of employees at a given point in time, we can look at part of the picture. How does length of service (LOS) relate to wages? The data here (data273.dat) is the LOS in months and wages for 60 women who work in Indiana banks. Wages are yearly total income divided by the...

  • using python in eclipses Question I am attempting to solve My attempt... 1. Add a new...

    using python in eclipses Question I am attempting to solve My attempt... 1. Add a new module named twenty_questions_class to the package library. 2. Define a class named TwentyQuestions in the module with an instance constructor and a method. a. The instance constructor _init is used to create an instance of the TwentyQuestions class with a value for the RANGE. b. The method named play lets the user play the game. For example, I am thinking of a secret number...

ADVERTISEMENT
Free Homework Help App
Download From Google Play
Scan Your Homework
to Get Instant Free Answers
Need Online Homework Help?
Ask a Question
Get Answers For Free
Most questions answered within 3 hours.
ADVERTISEMENT
ADVERTISEMENT
ADVERTISEMENT