Question: CS 140 Object Oriented C++ Homework Concept: Constructors Combination Lock (60 points) Name: Date: Implement a class ComboLock that works like the combination locker used

 CS 140 Object Oriented C++ Homework Concept: Constructors Combination Lock (60

CS 140 Object Oriented C++ Homework Concept: Constructors Combination Lock (60 points) Name: Date: Implement a class ComboLock that works like the combination locker used in gym lockers and right in our hall art lockers. The locker is constructed with a combination, three random numbers between 0 and 39. You should have one parameterized constructor that sets the three random numbers. The default constructor will set the combination to 10 20, 30. There will be a reset function that resets the dial so that it points to 0. The turn left and turn Right functions turn the dial by a given number of ticks to the left or to the right. The open method attempts to open the lock. The lock will open if the user first turned it to the right to the first number in the combination, then left to the second, and then right to the third. Write a main that tests the default and parameterized constructors. You should have one example that does not open the lock and one example that opens the lock. Success or Failure should be displayed in the function open

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!