My professor has given me an assignment on Pay roll system in python.
There's one feature of printing Employees:
All Employees
Print by Attributes
Print by Id
Print by Name
Print by Designation
Print by Salary
Print less than (<)
Print greater than (>)
... all possible conditions
Print by Department
Now how do I implement these functions ? I don't need any code, I just want some help in implementing these functions.
I have a main program main.py which in turn will call these functions.
For example If I have a function called ById() in print.py then, should I take user input and display the result in the function itself or should I create a dictionary (kind of array) and store the result in the dictionary and then return it?
But if I return a dictionary there will be iteration of records in two places first for storing result in ById() function and second iteration in main.py for displaying result.
And if I add user input and print result in the function itself then the function becomes less reusable.
What should I do ? Can some one point me in a right direction ?
Edit 1:
Note : We are not done with Object Oriented Programming yet : (
Thanks.