COL 100 Assignment 5
COL 100 Assignment 5
2. Before using any function from any existing library or using any algo-
rithm not covered in the class, get a confirmation from the instructors
by posting on Piazza.
Additional Resources:
For a refresher on the concepts related to the assignment, you can refer to the course
lecture notes, slides, and relevant sections from the textbook. Assignment Grading:
Your assignments will be graded on correctness, efficiency of your code, proper usage of
comments, and adherence to the submission guidelines. We wish you the best of luck
with the assignment.
2 BitCrypt
With the ongoing disputes between countries, safeguarding the nuclear codes have become
a major challenge. You are appointed by the Defense Ministry of India to devise a robust
encryption-decryption technique to secure the nuclear codes of India. With your love for
bitwise XOR and recursion, you decide to deploy a recursive encryption algorithm.
Following is the truth table for XOR:
Assume that the number is 7 (Binary: 111) and the key is 5 (Binary: 101) A bitwise
XOR would yield the output as 010. Hence, 2 (Binary: 010) would be the encrypted
message.
Encrypted message: 010 and the key: 101
Note: To ensure that recursion is used to solve the problem, we will output certain
intermediate state values for testing and check for stack depth. Learn more about stack
depth here: https://www.youtube.com/watch?v=BNeOE1qMyRA
1. Employee ID (integer)
Page 2
2. First Name (string)
4. Salary (integer)
You need to implement the following tasks by creating function for each task:
6. Task 6 : Display the statistical detail of employees salary which are currently work-
ing in company. Statistical Detail include Minimum,Maximum and Mean(Average)
value of Salary for currently working Employees upto two decimal place.
7. Task 7 : Find the number of employees working in company for a given particular
date.
Here 1 is represent Task 1, ”23” represent Employee ID, ”John” represent First
Name, ”Doe” represent Last Name, ”1200” represent salary, ”12/03/2012” repre-
sent Joining Date.
2. Task 2 : 2 23.
Page 3
3. Task 3 : 3 23
4. Task 4 : 4
Here 4 represent Task 4 , in this you have to display details of all Employees
currently working at company.
5. Task 5 : 5 23 1500
Here 6 represent Task 6, in this you have to display the Minimum, Maximum
and Mean value of Salary of currently working Employees.
7. Task 7 : 7 06/04/2012
Here 7 represent Task 7, You have to print a number which represent number
of employees currently working at company on 06/04/2012.
Page 4
6
7 10/04/2013
3.5 Explanation
First line in Sample Input is 9 which represent number of tasks to perform.
Next line in Sample Input is 1 23 John Doe 1200 12/03/2012 which represent Task
1 i.e., Adding employee John Doe with ID 23, Salary 1200 and Joining Data 12/03/2012.
Next line in Sample Input is 1 16 Anu Arora 1500 09/03/2012 which represent
Task 1 i.e., Adding employee Anu Arora with ID 16, Salary 1500 and Joining Data
09/03/2012.
Next line in Sample Input is 1 8 Dheeraj Kumar 1800 12/03/2014 which repre-
sent Task 1 i.e., Adding employee Dheeraj Kumar with ID 8, Salary 1800 and Joining
Data 12/03/2014.
Next line in Sample Input is 3 16 which represent Task 3 i.e., Displaying details of
employee with ID 16. Hence in First line of Sample Output ,detail of employee with id
16 (i.e., Anu Arora) is printed/displayed.
Next line in Sample Input is 2 16 which represent Task 2 i.e., Removing details of
employee with ID 16(i.e., Anu Arora).
Next line in Sample Input is 4 which represent Task 4 i.e., Displaying details of all
employees currently working on company. As for now ”Anu Arora” is removed from list
of employees so the remaining employee ”Dheeraj Kumar” and ”John Doe” details will
be display (as can be seen in Sample Output line 2 and 3). Output/Print details of
each employee according to their employee ID in ascending order.
Page 5
Next line in Sample Input is 5 8 1700 which represent Task 5 i.e., Salary of employee
”Dheeraj Kumar” (with Id 8) is changed from 1800 to 1700.
Next line in Sample Input is 6 which represent Task 6 i.e., To display the statistical
data of employees salaries who are currently working in the company. Hence as we have
two employees left in company ”Dheeraj Kumar” and ”John Doe” with salary 1700 and
1200 respectively. Hence Minimum, Maximum and Mean value will be 1200 , 1700 and
1450 respectively.
Next line in Sample Input is 7 10/04/2013 which represent Task 7 i.e., To count
the number of employees which are working on 10/04/2013.
As from our employees list we can see that only ”John Doe” had start working from
12/03/2012 and ”Dheeraj Kumar” join later (i.e., from 12/03/2014). Hence ”John
Doe” is the only employee who is working on 10/04/2013”. Hence count=1.
Note : Each task will be performed on current list of employees during that particular
task time.
Page 6