Question: File for implementation of an hr system. See slides for requirements #Note: If you want to enforce the abstractness
File for implementation of an hr system. See slides for requirements
#Note: If you want to enforce the abstractness of Person, make it abstract using the ABC class
# you can also use the @abstractmethod decorator for abstract methods
#from abc import ABC, abstractmethod
#class PersonABC
from given.person import Person
#function to write print to screen the checks for the employee
def writecheckemployee:
if isinstanceemployee Employee:
printstremployee $ stremployeegetweeklypay
else:
printERROR: cannot write a check to a nonemployee"
if namemain:
people
johnstevens StudentJohn "Stevens",
printstrjohnstevens is class strtypejohnstevens
people.appendjohnstevens
# cindystevens EmployeeCindy "Stevens", "System Administrator"
# printstrcindystevens is class typecindystevens
# printstrcindystevens makes strcindystevens.getweeklypay per week"
# people.appendcindystevens
#
# johnstone StudentEmployeeJohn "Stone", "Tutor"
# printstrjohnstone is class strtypejohnstone
# printstrjohnstone makes strjohnstone.getweeklypay per week"
# people.appendjohnstone
#
# zazzyzanzibar EmployeeZazzy "Zanzibar", "Life Coach"
# printstrzazzyzanzibar is class strtypezazzyzanzibar
# printstrzazzyzanzibar makes strzazzyzanzibar.getweeklypay per week"
# people.appendzazzyzanzibar
#
# aprilalpha EmployeeApril "Alpha", "Lawn Care Specialist"
# printstraprilalpha is class strtypeaprilalpha
# printstraprilalpha makes straprilalpha.getweeklypay per week"
# people.appendaprilalpha
#
# manuelprezquiones EmployeeManuelPrez "Professor", "Quiones
# printstrmanuelprezquiones is class strtypemanuelprezquiones
# printstrmanuelprezquiones makes strmanuelprezquionesgetweeklypay per week"
# people.appendmanuelprezquiones
#
# printOrdered list of employees at CNU:"
# people.sort
# printpeople
# for person in people:
# printperson
#
# # Exercise append an a to the employee name. Does your sort method still work?
# # What string method is being called in Make it Person
#
# # Exercise what string method is student employee calling?
# # The order you inherit matters
#
# # Exercise Abstract classes. You can enforce abstractness using the ABC class
# # you can also use the @abstractmethod decorator for abstract methods
# # Try changing the class constructor of Person to:
# # from abc import ABC, abstractmethod
# # lass PersonABC
#
# # Exercise Polymorphism: type vs isInstance
# print
type vs isinstance
# printtype of johnstone strtypejohnstone
# printtypejohnstone StudentEmployee", typejohnstone StudentEmployee
# printtypejohnstone typeStudent typejohnstone typeStudent
# printtypejohnstoneisInstanceStudent isinstancejohnstone, Student
#
# #Write some checks Polymorphism demo
# print
Writing Checks"
# printJohn Stone is a Student Employee"
# writecheckjohnstone
# printApril Alpha is an Employee"
# writecheckaprilalpha
# printJohn Stevens is not an Employee, just a Student"
# writecheckjohnstevens
Step by Step Solution
There are 3 Steps involved in it
1 Expert Approved Answer
Step: 1 Unlock
Question Has Been Solved by an Expert!
Get step-by-step solutions from verified subject matter experts
Step: 2 Unlock
Step: 3 Unlock
