from employee import Employee, Manager omar = Employee('Omar', 'Hossam', 'Developer', 1000) # omar.info() yasin = Manager('Yasin', 'Hasanin', 'Team Lead', 100000, [omar]) khaled = Employee('Khaled', 'Elsayed', 'Team Lead', 10000) yasin.team.append(khaled) yasin.team.remove(khaled) # yasin.emps_info() # E.generate_emp(str) , M.generate_mang(str) Employee.total_emps Manager.total_mangs
from call_center import CallCenter from employee import Respondant, Manager, Director employees = [ Respondant('Jason'), Respondant('Tiffany'), Respondant('Stevenson'), Respondant('Alec'), Respondant('Keith'), Manager('Rajiv'), Manager('Kasandra'), Manager('Paul'), Director('Stephen'), Director('Saxon') ] call_center = CallCenter(employees) call_center.dispatch_call() call_center.dispatch_call() call_center.dispatch_call() call_center.dispatch_call() print(call_center)
from employee import Employee, Manager bob = Employee('Bob Smith') sue = Employee('Sue Jones', job='dev', pay=100000) tom = Manager('Tom Jones', 50000) import shelve db = shelve.open('persondb') for obj in (bob, sue, tom): db[obj.name] = obj db.close()
def setUp(self): self.mng1 = Manager("jane", "doe", 600) self.mng2 = Manager("jane", "doe", 600, [self.empl1, self.empl2])
## Ch10 p10.9 from employee import Manager, Excutive m1 = Manager('Alex', 60000, 'Sales') print(m1) e1 = Excutive('Bob', 100000, 'Marketing') print(e1)
from employee import Employee, Manager e1 = Manager(10, "ritesh") e2 = Manager(2, "Navneet") a = [e1, e2] a.sort() print(a[0].id) print(a[1].id)
from employee import HourlyEmployee, SalariedEmployee, Manager def print_salaries(staff): for employee in staff: name = employee.get_name() hours = int(input("Hours worked by " + name + ": ")) pay = employee.weekly_pay(hours) print("{}: {:.2f}".format(name, pay)) # The main program starts here staff = [] staff.append(HourlyEmployee("Harry Morgan", 35.0)) # 30.0 is the hourly wage staff.append(SalariedEmployee("Sally Lin", 78000.0)) # 52000 is the annual salary staff.append( Manager("Mary Smith", 91000.0, 60.0)) # 104000 is the annual salary, 50.0 is the weekly bonus print_salaries(staff)
from employee import Manager from employee import Attendant from employee import Cook from employee import Mechanic from reporting import AccountingReport from reporting import StaffingReport from reporting import ScheduleReport from shift import MorningShift from shift import AfternoonShift from shift import NightShift employees = [ Manager("Vera", "Schmidt", 2000, MorningShift()), Attendant("Chuck", "Norris", 1800, MorningShift()), Attendant("Samantha", "Carrington", 1800, AfternoonShift()), Cook("Roberto", "Jacketti", 2100, MorningShift()), Mechanic("Joe", "Rama", 2000, MorningShift()), Mechanic("Dave", "Dreilig", 2200, MorningShift()), Mechanic("Tina", "River", 2300, AfternoonShift()), Mechanic("Chuck", "Rainey", 1800, NightShift()), ] reports = [ AccountingReport(employees), StaffingReport(employees), ScheduleReport(employees), ] for r in reports: r.print_report() print()
print("Today is", time.strftime('%c')) # print(emp1) print(emp1.fullname) emp1.update_name('Vishak Dev') print(emp1.fullname) tester1 = Tester('Hashmi', 'Jose', 190018, 40000, 'Manual', 'Cloud') print(tester1.email) # print (help(Tester)) mgr1 = Manager('Sanjiv', 'Keswani', 10018, 940000, 'Cloud', [emp1]) mgr1.add_emp(emp2) mgr1.list_emps() print(mgr1.salary) mgr1.salary_raise() print(mgr1.salary) print(emp1.salary) # Employee.raise_amount(1.08) emp1.salary_raise() print(emp1.salary)