Generation

generate functionWed, 21 Dec 2022

Change this function so that the employee's awards are also taken into account (add this variable to the class) and the employee's promotion condition is taken into account by the formula if (self.seniority)+(self.intlawards*2) % 7 == 0: self.grade_up() class Developer(Employee): def __init__(self, name, seniority): super().__init__(name, seniority) def check_if_it_is_time_for_upgrade(self): # for each accreditation, increase the counter by 1 # for now we assume that all of the developers pass the accreditation self.seniority += 1 # condition of promoting an employee from the presentation if self.seniority % 5 == 0: self.grade_up() # publication of the results return self.publish_grade()

class Managers(Employee): def __init__(self, name, seniority, awards): super().__init__(name, seniority) self.intlawards = awards def check_if_it_is_time_for_upgrade(self): # for each accreditation, increase the counter by 1 # for now we assume that all of the developers pass the accreditation self.seniority += 1 # condition of promoting an employee from the presentation if (self.seniority)+(self.intlawards*2) % 7 == 0: self.grade_up() # publication of the results return self.publish_grade() def add(a, b): return a + b add(1, 2)

Questions about programming?Chat with your personal AI assistant