Attributes: empno, ename, salary Methods: cal_salary() [abstract method] display() should display information empno, ename Make a subclass of Employee with the name PermanentEmployee with the following attributes and methods: Attributes: empno, ename, basic_salry, bouns Methods: cal_salary() : [basic_salary + bouns] display() should display information empno, ename, salary Make another subclass of Employee with the name ContractEmployee with the following attributes and methods: Attributes: empno, ename, day_sal, days_worked Methods: cal_salary(): [day_sal * days_worked] display() should display information empno, ename, salary Add at least 5 employees of different types and test the application. ''' from employee import Employee, PermanentEmployee, ContractEmployee if __name__ == "__main__": e1 = Employee('2001', 'Praneeth', 1000000) e2 = PermanentEmployee('2002', 'Malya', 100000, 2000) e3 = ContractEmployee('2001', 'Joy', 10000, 25) e1.display() e2.display() e3.display()
from employee import Employee emp2 = Employee("Abc", "xyz") emp2.display()
import Pyro4.util from employee import Employee sys.excepthook = Pyro4.util.excepthook library = Pyro4.Proxy("PYRONAME:example.library") employee = Employee() f = open('./tasks.txt', 'r') try: reader = csv.reader(f) for row in reader: print(row) if(row[0] == 'a'): employee.add_book(row, library) #add book elif(row[0] == 'sy'): employee.select_year(row[1], row[2], library) #select book by year elif(row[0] == 'd'): employee.display(library) #display all the book elif(row[0] == 'si'): employee.select_ISBN(row[1],library) #select book by ISBN elif(row[0] == 'ol'): employee.on_loan(row[1],library) #set book on loan by ISBN elif(row[0] == 'nol'): employee.not_on_loan(row[1],library) #set book not on loan by ISBN finally: f.close()