Question: 1. Write this code using Python and create a UML diagram to represent the relationship visually. Run the code to answer the following questions: a.

1. Write this code using Python and create a UML diagram to represent the relationship visually. Run the code to answer the following questions: a. What is the output of this code? b. Can a HumanResourceManager access the _ str _ function from the employee class in one of its functions? c. Can a ProjectManager access the _____function from the employee class in one of its functions? d. What is the difference between HRM and PM objects in terms of their relationship with the Employee? (Aggregation or Composition) e. What happened to the Employee class object when we used del PM in this code? f. Uncomment del HRM. Explain what happened and why? H Classes class smployee: def init _ (self, name): self Employee Eame = name def _str (self): return "The Employee" + self._Employee_ name def del (seif): ciass name self class name print("nn", class name, "destroyed (n") class HumanResourcelManager: def init_(self, titienename): self tittelintitie self Employes employedename) def mamagez (self)! return "In" + self. Employee._str__) " "is created and managed by " + self._title def del (self): class namee self. class. name print( (n, class name, "destroyed (n") class ProjectManager def init (self, tide, emp) self title titie self Employee =emp def rimanges(self): return "(n" + self. Employee _str_ (i) 7 "is managed by" + self tille def del (self): class name nelf. selass name print (")n" class name, "destroyed (n) \# Testing HRM = HumanResourcetianager ('Sir Hassan (HRM)', 'Dr Hameed') print(HRM manages()) \# del HRM employee1 - Employee('Farooq') PM = Project Manager ( Dor Zakaria (PM)', employeet) print(PMimanages(o) del RM
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
