Question: Java file names: Problem4.java and Problem4Tester.java Problem 5. (20 points) Write a Java class comboLock that works like the combination lock in a gym locker.

Java file names: Problem4.java and Problem4Tester.java Problem 5. (20 points) Write a Java class comboLock that works like the combination lock in a gym locker. The lock is constructed with a combination, three numbers between o and 39. The reset method resets the dial so that it points to O. The turnLeft and turnRight methods turn by a given number of ticks to the left or right. The open method attempts to open the lock. The lock opens if the user first turned it right to the first number in the combination, then left to the second, and then right to the third. The class and its methods' signatures are as follows: public class ComboLock public ComboLock (int secretl, int secret2, int secret3) t . . . 1 public void turniettint ticka) public void turnLeft (int ticks) t.. . ) public void turnRight (int ticks) . . public boolean open) ( . .. ) Also, provide a tester class, comboLockTester, that tests the above class using various combinations entered by a user inside a loop. User will exit from the loop by entering three Os as the combination
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
