Exemple #1
0
import employees as emp
import productivity as ps
import payroll as hr

manager = emp.Manager(1, 'John Smith', 1500)
secretary = emp.Secretary(2, 'Jane Doe', 1200)
sales_guy = emp.SalesPerson(3, 'Kevin Bacon', 1000, 250)
factory_worker = emp.FactoryWorker(4, 'Pete Peterson', 40, 15)
temporary_secretary = emp.TemporarySecretary(5, 'Robin Williams', 40, 9)

employees = [
    manager, secretary, sales_guy, factory_worker, temporary_secretary
]

productivity_system = ps.ProductivitySystem()
productivity_system.track(employees, 40)

payroll_system = hr.PayrollSystem()
payroll_system.calculate_payroll(employees)
Exemple #2
0
import hr
import employees
import productivity

manager = employees.Manager(1, 'Mary Poppins', 3000)
secretary = employees.Secretary(2, 'John Smith', 1500)
sales_guy = employees.SalesPerson(3, 'Kevin Bacon', 1000, 250)
factory_worker = employees.FactoryWorker(2, 'Jane Doe', 40, 15)
temporary_secretary = employees.TemporarySecretary(5, 'Robin Williams', 40, 2)
employees = [
    manager,
    secretary,
    sales_guy,
    factory_worker,
    temporary_secretary,
]
productivity_system = productivity.ProductivitySystem()
productivity_system.track(employees, 40)
payroll_system = hr.PayrollSystem()
payroll_system.calculate_payroll(employees)
Exemple #3
0
import hr
import employees
import productivity
import contacts

manager = employees.Manager(1, 'Jose Contreras', 1500)
manager.address = contacts.Address('121 Admin Road', 'Concord', 'NH', '03301')

secretary = employees.Secretary(1, 'Laura Vergara', 750)
secretary.address = contacts.Address('121 Admin Road', 'Concord', 'NH',
                                     '03301')

sales_guy = employees.SalesPerson(3, 'Pablo Espinoza', 1000, 250)
factory_worker = employees.FactoryWorker(4, 'Gustavo Cumare', 40, 20)
temporary_secretary = employees.TemporarySecretary(5, 'Fabiola Barrueta', 40,
                                                   9)

# we comment this because Employee is an Abstract Class, so It can be instaciated
# generic_employee = hr.Employee(4, 'Generic Employee')

employees_list = [
    manager, secretary, sales_guy, factory_worker, temporary_secretary
]

productivity_system = productivity.ProductivitySystem()
productivity_system.track(employees_list, 40)

payroll_system = hr.PayrollSystem()
payroll_system.calculate_payroll(employees_list)