教师工资管理系统源代码
时间: 2024-01-11 14:03:53 浏览: 74
教师管理系统源代码.zip
根据提供的引用内容,我无法直接提供教师工资管理系统的源代码。但是,我可以为您提供一个简单的示例,演示如何使用Python编写一个教师工资管理系统的源代码。
```python
class Teacher:
def __init__(self, name, salary, id, gender, age, phone):
self.name = name
self.salary = salary
self.id = id
self.gender = gender
self.age = age
self.phone = phone
class SalaryManagementSystem:
def __init__(self):
self.teachers = []
def add_teacher(self, teacher):
self.teachers.append(teacher)
def display_teachers(self):
for teacher in self.teachers:
print("Name: ", teacher.name)
print("Salary: ", teacher.salary)
print("ID: ", teacher.id)
print("Gender: ", teacher.gender)
print("Age: ", teacher.age)
print("Phone: ", teacher.phone)
print()
def sort_teachers_by_salary(self):
self.teachers.sort(key=lambda x: x.salary, reverse=True)
# 创建教师工资管理系统对象
system = SalaryManagementSystem()
# 添加教师信息
teacher1 = Teacher("John", 5000, 1, "Male", 30, "1234567890")
teacher2 = Teacher("Alice", 6000, 2, "Female", 35, "9876543210")
teacher3 = Teacher("Bob", 4000, 3, "Male", 28, "5678901234")
system.add_teacher(teacher1)
system.add_teacher(teacher2)
system.add_teacher(teacher3)
# 显示教师信息
system.display_teachers()
# 按工资降序排列并显示教师信息
system.sort_teachers_by_salary()
system.display_teachers()
```
这个示例代码演示了一个简单的教师工资管理系统,使用了Python的面向对象编程。您可以根据自己的需求进行修改和扩展。
阅读全文