Advertisement
Guest User

Untitled

a guest
Mar 24th, 2021
177
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 1.08 KB | None | 0 0
  1. class Employee:
  2.     def __init__(self, first_name, last_name, employee_id):
  3.         self.first_name = first_name
  4.         self.last_name = last_name
  5.         self.employee_id = employee_id
  6.         self.base_salary = 0
  7.     def set_base_salary(self, base_salary):
  8.         self.base_salary = base_salary
  9.         return base_salary
  10.  
  11. class TeachingStaff(Employee):
  12.     def __init__(self, first_name, last_name, employee_id, teaching_area, category):
  13.         super().__init__(first_name, last_name, employee_id)
  14.         self.teaching_area = teaching_area
  15.         self.category = category
  16.     def get_salary(self, base_salary):
  17.         salary = self.category*10+100/100*self.base_salary
  18.         return salary
  19.     def get_staff_info(self):
  20.         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))
  21.  
  22. jerry = TeachingStaff('Jerry', 'Smith', 110022123, 'IT', 3)
  23. jerry.set_base_salary(90000)
  24. print(jerry.get_staff_info())
  25.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement