Question: please please please make this program in c++, not java . Assignment Description. Design a class called ComboLock that works like the nurnber combination lock

please please please make this program in c++, not java .  please please please make this program in c++, not java .
Assignment Description. Design a class called ComboLock that works like the nurnber
combination lock in a gym locker. A combination lock is opened with

Assignment Description. Design a class called ComboLock that works like the nurnber combination lock in a gym locker. A combination lock is opened with a simple procedure: turn the lock's dial to the right until you reach the first number in the combinatin. Then turn the lock to the left u you reach the second number. Finally, turn to the right uni the third number is reached. If the three numbers were correct, the lock will open. A Combolock object is constructed with three integers from 0-39 representing the combination needed to unlock the object. Create a new C++program and make a class named ComboLock. Design the class to these specifications: 1. You will need three member variables to represent the three integers needed to open the lock. Choose an appropriate type and names for these variables. Make sure your member variables are private and NOT static. 2. Add a fourth member variable to represent the current position of the lock's dial (the part that spins) 3. Add a constructor that takes three values for the lock's combination and initializes the member variables accordingly. The dial position should start at 0. You may assume the combination numbers are always between 0 and 39 . Add an accessor method getDialPosition, which returns the current dial position of the lock. 5. Add these methods to manipulate the lock (a) void reset: set the dial position back to 0 and start the unlocking procedure over again. (b) void turnLeft (int ticks): tur the dial to the left by the specified number of ticks from the current position. The ticks parameter is NOT the number you wish to turn to it is how many positions to move from where you currntly are. Example: if the current position is at 10, then turnLeft (10) would turn the dial to 20 (c) void turnRight(int ticks): likewise, turns the dial to the right by the specified number of ticks (d) boolean open (): attempts to open the lock. If the user's most recent turnRight, turnLeft turnRight methods entered the coct three combination numbers, then the method returns true and resets the lock. Otherwise the method returns false and resets the lock. i. This method is one of the harder parts of the lab. You will need to add member variables to the ComboLock class to help you with this method. You will need some way of rembering all three numbers that the user spun the lock to. You wll also need to make sure the user spun the correct direction each tme, not solely that they landed on the right number

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!