Created
September 3, 2017 15:54
-
-
Save uruskan/e10fb07820904c5ecb27f07e0a8b7b57 to your computer and use it in GitHub Desktop.
Emplooye System
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Employees = { | |
} | |
class Employee(object): | |
'Common base for all employes' | |
empCount = 0 | |
def __init__(self,name,salary,age): | |
self.name = name | |
self.salary = salary | |
self.age = age | |
Employee.empCount += 1 | |
def displayCount(self): | |
print ("Total Employee : " , Employee.empCount , "\n") | |
def displayEmployee(self): | |
print("Name : ", self.name ," Salary : " , self.salary ," Age : " , self.age, "\n") | |
print ("NEVER FORGET TO SAVE YOUR CHANGES ! \n") | |
print ("Press s to save your work ! \n") | |
print ("Press l to load database. \n") | |
print ("Press x for adding employee \n") | |
print ("Press y for show employee count \n") | |
print ("Press z for display employee \n") | |
print ("Press q for quitting. \n") | |
while True : | |
st = input("->> : ") | |
if (st == "x"): | |
eid = input ("Id : ") | |
eName = input ("\nName : ") | |
eSalary = input ("\nSalary : ") | |
eAge = input ("\nAge : \n") | |
Employees[eid] = Employee(eName,eSalary,eAge) | |
if (st == "y"): | |
print("Total Employee Count : " , Employee.empCount) | |
if (st == "z"): | |
wantedId = input("Give the id : ") | |
Employees[wantedId].displayEmployee() | |
if (st == "q"): | |
exit() | |
if (st == "s"): | |
print("This module still under development") | |
if (st == "l"): | |
print("This module still under development.") | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment