Prepare demo program that implements all of above method

Assignment Help JAVA Programming
Reference no: EM13700793

Question: Specify, design, and implement a class that can be used in a program that simulates a combination lock.

The lock has a circular knob with the numbers 0 through 39 marked on the edge, and it has a three-number combination, which we will call x,y,z.

In order to open the lock, you must turn the knob clockwise at least one entire revolution, stopping with x at the top; then you turn the knob counterclockwise, stopping the "second" time that y appears at the top; finally, you turn the knob clockwise again, stopping the next time that z appears at the top. At this point, you may open the lock.

Your "Lock" class should have a constructor that initializes the 3-number combination (use 0,0,0 for default arguments in defaut constructor)

Also, provide the subsequent methods:

Part 1: To alter the lock's combination to a new 3-number combination

Part 2: To turn the knob in a given direction until a specified number appears at the top. (You also must show all of the numbers in the output as the lock is being turned - could use a for loop)

Part 3: To close the lock

Part 4: To attempt to open the lock

Part 5: To inquire about the status of the lock (open or closed)

Part 6: To tell what number is currently at the top.

Write a demo program that uses all of the above methods.

You need to prepare a demo program that implements all of the above methods.

Reference no: EM13700793

Questions Cloud

How many mol of single bonds are broken : Question- How many mol of single bonds are broken when 2 mol of hydrogen reacts with 1 mol of nitrogen to form hydrazine (N2H4)
What volume naoh is required to react : Question- What volume (in mL) of 1.62 M NaOH is required to react with 26.9 mL of 1.25 M citric acid according to the following reaction
Determine the order of insertions : Determine the order of insertions with this set of numbers that will result in a perfectly balanced BST(Binary Search Tree) and show the result of a preorder traversal of this tree.
What volume of aluminum with a density : Question- What volume of aluminum (in cm3) with a density of 2.70 g/cm3 is required to have 6.02 g of aluminum?
Prepare demo program that implements all of above method : Specify, design, and implement a class that can be used in a program that simulates a combination lock.
What volume of hcl is required to react with zinc : Question- What volume (in mL) of 2.44 M HCl is required to react with 3.78 g of zinc according to the following reaction
Two phase routing algorithm : Two Phase Routing Algorithm: use the analysis of the first phase to give a full analysis (no "symmetry" argument) of the second phase.
What is the ph for the reaction : Question- When 0.298 moles of B completely reacts according to the reaction above, 49.9 kJ of energy is released. What is the pH for the reaction as written above
Identify the modality of the relationship : You are working on the database design that will support PPI's new order entry system. PPI has many thousands of customers around the world who place and pay for orders. One customer can place an order for many products at a time.

Reviews

Write a Review

JAVA Programming Questions & Answers

  Recursive factorial program

Write a class Array that encapsulates an array and provides bounds-checked access. Create a recursive factorial program that prompts the user for an integer N and writes out a series of equations representing the calculation of N!.

  Hunt the wumpus game

Reprot on Hunt the Wumpus Game has Source Code listing, screen captures and UML design here and also, may include Javadoc source here.

  Create a gui interface

Create GUI Interface in java programing with these function: Sort by last name and print all employees info, Sort by job title and print all employees info, Sort by weekly salary and print all employees info, search by job title and print that emp..

  Plot pois on a graph

Write a JAVA program that would get the locations of all the POIs from the file and plot them on a map.

  Write a university grading system in java

University grading system maintains number of tables to store, retrieve and manipulate student marks. Write a JAVA program that would simulate a number of cars.

  Wolves and sheep: design a game

This project is designed a game in java. you choose whether you'd like to write a wolf or a sheep agent. Then, you are assigned to either a "sheep" or a "wolf" team.

  Build a graphical user interface for displaying the image

Build a graphical user interface for displaying the image groups (= cluster) in JMJRST. Design and implement using a Swing interface.

  Determine the day of the week for new year''s day

This assignment contains a java project. Project evaluates the day of the week for New Year's Day.

  Write a java windowed application

Write a Java windowed application to do online quiz on general knowledge and the application also displays the quiz result.

  Input pairs of natural numbers

Java program to input pairs of natural numbers.

  Create classes implement java interface

Interface that contains a generic type. Create two classes that implement this interface.

  Java class, array, link list , generic class

These 14 questions covers java class, Array, link list , generic class.

Free Assignment Quote

Assured A++ Grade

Get guaranteed satisfaction & time on delivery in every assignment order you paid with us! We ensure premium quality solution document along with free turntin report!

All rights reserved! Copyrights ©2019-2020 ExpertsMind IT Educational Pvt Ltd