Advertisement
TornioSubito

Farmacia

Jun 21st, 2016
67
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.14 KB | None | 0 0
  1. class Medicinale:
  2. def __init__(self,[name,disp]):
  3. #@param nome : string
  4. #@param disp : string ('D' or 'ND')
  5. self.name=name
  6. self.disp=disp
  7.  
  8. class Farmacia:
  9. def __init__(self,nome,tel,ind,med):
  10. #@param nome : string
  11. #@param tel : string (of integers)
  12. #@param ind : string (indirizzo della farmacia)
  13. #@param med : list (lista di oggetti di tipo Medicinale)
  14. self.nome=nome
  15. self.tel=tel
  16. self.ind=ind
  17. self.med=med
  18.  
  19. def removeMed(self,medName):
  20. #@param medName : string
  21. for i in self.med:
  22. if self.med[i[0]]==medName:
  23. self.med.pop(i)
  24.  
  25. def addMed(self,newMed):
  26. #@param newMed : Medicinale
  27. self.med.append(newMed)
  28.  
  29. def getDisp(self,medName):
  30. #@param medName : string
  31. for i in self.med:
  32. if self.med[i[0]]==medName:
  33. return self.med[i[1]]
  34.  
  35.  
  36. class Farmacia_Notturna(Farmacia):
  37. def __init__(self,nome,tel,ind,med,orario):
  38. #@param nome : string
  39. #@param tel : string (of integers)
  40. #@param ind : string
  41. #@param med : list (of Medicinale objects)
  42. #@param orario : string
  43. Farmacia.__init__(self,nome,tel,ind,med)
  44. self.orario=orario
  45.  
  46. def getSchedule(self):
  47. return self.orario
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement