Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- class Employee:
- def __init__(self, first_name, last_name, employee_id):
- self.first_name = first_name
- self.last_name = last_name
- self.employee_id = employee_id
- self.base_salary = 0
- def set_base_salary(self, base_salary):
- self.base_salary = base_salary
- return base_salary
- class TeachingStaff(Employee):
- def __init__(self, first_name, last_name, employee_id, teaching_area, category):
- super().__init__(first_name, last_name, employee_id)
- self.teaching_area = teaching_area
- self.category = category
- def get_salary(self, base_salary):
- salary = self.category*10+100/100*self.base_salary
- return salary
- def get_staff_info(self):
- print("First Name: ", self.first_name, "\nLast Name:", self.last_name, "\nEmployee ID:", self.employee_id, "\nArea of Expertise:", self.teaching_area, "\nCategory: ", self.category, "\nSalary: ", get_salary(self, base_salary))
- jerry = TeachingStaff('Jerry', 'Smith', 110022123, 'IT', 3)
- jerry.set_base_salary(90000)
- print(jerry.get_staff_info())
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement