Facebook
From Bistre Shama, 5 Months ago, written in Plain Text.
Embed
Download Paste or View Raw
Hits: 49
  1. from Person import Person
  2. from Staff import Staff
  3. from Temporary_Staff import Temporary_Staff
  4.  
  5.  
  6. input_str = input("Enter temporary staff details in comma separated value format\n")
  7. name, staff_id, hours_worked = input_str.split(",")
  8. temporary_staff = Temporary_Staff(name, staff_id, hours_worked)
  9. print("Temporary Staff Details")
  10. temporary_staff.display()
  11.  
  12.  
  13.  
  14. class Person:
  15.    
  16.     def __init__(self,name):
  17.         self._name=name
  18.        
  19.     def display(self):
  20.        
  21.         print("Name : "+self._name)
  22.  
  23.  
  24.  
  25.  
  26. from Person import Person
  27.  
  28. class Staff(Person):
  29.    
  30.     def __init__(self,name,staff_id):
  31.         self._staff_id=staff_id
  32.         super().__init__(name)
  33.        
  34.     def display(self):
  35.         super().display()
  36.         print("Staff Id : "+self._staff_id)
  37.  
  38.  
  39. from Staff import Staff
  40.  
  41. class Temporary_Staff(Staff):
  42.    
  43.     def __init__(self,name,staff_id,hours_worked):
  44.         self._hours_worked=hours_worked
  45.         super().__init__(name,staff_id)
  46.    
  47.     def display(self):
  48.        
  49.         super().display()
  50.         print("Number of hours worked : "+self._hours_worked)
  51.            
  52.