NATIONAL UNIVERSITY OF MODERN LANGUAGES
ISLAMABAD DEPARTMENT OF SOFTWARE
ENGINEERING
Assignment 1
Due date: 24th Feb 2025
Note: upload the soft copy of the assignment on LMS and submit hard copy on
24th Feb r
Question No. 1: [Marks 10; CLO 1]
Implement a Class Combo lock that works in the combination of lock in a gym locker.
The lock is constructed with the combination of three number between 0 and 39.The
Reset method resets the dial so that it point to 0.The turn Left and turn Right methods
turn the dial by a given number of ticks to the left or right. The open methods attempt
to open the lock. The lock opens if the user turns it right to the first number in
combination the left to the second, and the right to the third
Class Combolock:
Combolock (int secret1,int secret2,int secret3)
Void rest();
Void turnleft(ticks)
…
Void turnright(ticks)
..
bool open();
ISLAMABAD DEPARTMENT OF SOFTWARE
ENGINEERING
Assignment 1
Due date: 24th Feb 2025
Note: upload the soft copy of the assignment on LMS and submit hard copy on
24th Feb r
Question No. 1: [Marks 10; CLO 1]
Implement a Class Combo lock that works in the combination of lock in a gym locker.
The lock is constructed with the combination of three number between 0 and 39.The
Reset method resets the dial so that it point to 0.The turn Left and turn Right methods
turn the dial by a given number of ticks to the left or right. The open methods attempt
to open the lock. The lock opens if the user turns it right to the first number in
combination the left to the second, and the right to the third
Class Combolock:
Combolock (int secret1,int secret2,int secret3)
Void rest();
Void turnleft(ticks)
…
Void turnright(ticks)
..
bool open();