NOTE: Don't Copy from the Chegg,
Use this method for a given question
3 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)
Trending nowThis is a popular solution!
Step by stepSolved in 2 steps
- Write a class named IceCreamCup that implements the Customizable interface. The class should have the following private instance variables. Do NOT give any method implementations for this question, but only declare the instance variables. Do NOT initialize the instance variables -- except nCups below. A String variable name describing the ice cream name • A List of Flavor s added to the cup. Name it flist Additionally, define the following static variable: • An int nCups describing the total number of ice cream cups instantiated. Initialize this variablearrow_forwardCSC 1302: PRINCIPLES OF COMPUTER SCIENCE II Lab 6 How to Submit Please submit your answers to the lab instructor once you have completed. Failure to submit will result in a ZERO FOR THIS LAB. NO EXCEPTIONS. The class diagram with four classes Student, Graduate, Undergraduate, and Exchange is given. Write the classes as described in the class diagram. The fields and methods for each class is given below. Student Exchange Graduate Undergraduate Student: Fields: major (String) gpa (double) creditHours (int) Methods: getGpa: returns gpa getYear: returns “freshman”, “sophomore”, “junior” or “senior” as determined by earned credit hours: Freshman: Less than 32 credit hours Sophomore: At least 32 credit hours but less than 64 credit hours Junior: At least credit hours 64 but less than 96 credit hours Senior: At least 96 credit hours Graduate:…arrow_forwardRuby-related coding: Need help in resolving the red-selected code parts of my practice problem, primarily dealing with case-sentitive, loops, and if-else statements. The ", :pending => true" needs to be removed, used for checking purposes. (Picture reference provided) Hangperson_game.rb class HangpersonGame# add the necessary class methods, attributes, etc. here# to make the tests in spec/hangperson_game_spec.rb pass.# Get a word from remote "random word" service# def initialize()# enddef initialize(word)@word = word@guesses = ""@wrong_guesses = ""enddef wordreturn @wordenddef guessesreturn @guessesenddef wrong_guessesreturn @wrong_guessesenddef guess(letter)if @word.include?(letter)@guesses += letterreturn true else@wrong_guesses += letterendenddef word_with_guessespartial_matches = ""@word.each_char do |w|partial_matches += "-"endreturn partial_matchesenddef check_win_or_loseif word_with_guesses.downcase == @word.downcasereturn :winelsif @wrong_guesses.length >= 7return…arrow_forward
- Computer Networking: A Top-Down Approach (7th Edi...Computer EngineeringISBN:9780133594140Author:James Kurose, Keith RossPublisher:PEARSONComputer Organization and Design MIPS Edition, Fi...Computer EngineeringISBN:9780124077263Author:David A. Patterson, John L. HennessyPublisher:Elsevier ScienceNetwork+ Guide to Networks (MindTap Course List)Computer EngineeringISBN:9781337569330Author:Jill West, Tamara Dean, Jean AndrewsPublisher:Cengage Learning
- Concepts of Database ManagementComputer EngineeringISBN:9781337093422Author:Joy L. Starks, Philip J. Pratt, Mary Z. LastPublisher:Cengage LearningPrelude to ProgrammingComputer EngineeringISBN:9780133750423Author:VENIT, StewartPublisher:Pearson EducationSc Business Data Communications and Networking, T...Computer EngineeringISBN:9781119368830Author:FITZGERALDPublisher:WILEY