SophiaPretty

(5)

$14/per page/Negotiable

About SophiaPretty

Levels Tought:
Elementary,Middle School,High School,College,University,PHD

Expertise:
Accounting,Algebra See all
Accounting,Algebra,Applied Sciences,Architecture and Design,Art & Design,Biology,Business & Finance,Calculus,Chemistry,Communications,Computer Science,Economics,Engineering,English,Environmental science,Essay writing Hide all
Teaching Since: Jul 2017
Last Sign in: 304 Weeks Ago, 1 Day Ago
Questions Answered: 15833
Tutorials Posted: 15827

Education

  • MBA,PHD, Juris Doctor
    Strayer,Devery,Harvard University
    Mar-1995 - Mar-2002

Experience

  • Manager Planning
    WalMart
    Mar-2001 - Feb-2009

Category > Computer Science Posted 06 Jan 2018 My Price 7.00

CombinationLock that stores information

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).

ï‚·- 2 constructors:

            - default constructor - sets the 3 combination numbers to zero and marks the lock as closed.

            - three parameter constructor - sets the 3 combination numbers to the three passed integers and marks the lock as open.

ï‚·- No accessor methods

ï‚· -A Boolean mutator method called setCombination, which is a 3 parameter method and sets the 3 combination numbers to the 3 passed numbers. It can only change the combination if the lock is closed. If the lock is open it returns false as it could not change the combination. If the lock is closed it returns true after it has reset the combination.

ï‚·- A public void method called closeLock() which set the status of the lock as closed.

ï‚·- A public Boolean method isLockOpen() which returns true if the lock is open and false if it is closed.

ï‚· -A public Boolean method called openLock() which is a 3 parameter method whose purpose is to checks if the supplied combination is the correct one. If it is correct it sets the status to open and returns true. If it is incorrect it returns false.

ï‚·- A public integer method HowManyCorrect() which is a 3 parameter method. It returns the count of correct numbers in the supplied combination.

ï‚· -A toString() method to return the combination of the lock in the following format: Clockwise num1 - Counter-Clockwise num2 - Clockwise num3 where num1, num2 and num3 are the values of the instance variables corresponding to the combination which will open the lock.

ï‚· -An equals() method to test for equality of the combination of two objects of class CombinationLock. We don't care whether they are open or closed.

 

I need help creating this class

Answers

(5)
Status NEW Posted 06 Jan 2018 12:01 PM My Price 7.00

-----------  ----------- H-----------ell-----------o S-----------ir/-----------Mad-----------am ----------- Th-----------ank----------- yo-----------u f-----------or -----------you-----------r i-----------nte-----------res-----------t a-----------nd -----------buy-----------ing----------- my----------- po-----------ste-----------d s-----------olu-----------tio-----------n. -----------Ple-----------ase----------- pi-----------ng -----------me -----------on -----------cha-----------t I----------- am----------- on-----------lin-----------e o-----------r i-----------nbo-----------x m-----------e a----------- me-----------ssa-----------ge -----------I w-----------ill----------- be----------- qu-----------ick-----------ly

Not Rated(0)