Academic Integrity: tutoring, explanations, and feedback — we don’t complete graded work or submit on a student’s behalf.

I need the code in python and i know its not free im paying 14.99 per month. In

ID: 3749277 • Letter: I

Question

I need the code in python and i know its not free im paying 14.99 per month.

In this assignment you are asked to write a Python program to define a class to model the characteristics of a generic employee. The class is part of a slightly larger program that includes code to use the class to create some employce objects and test its methods. The name of the class is "Employee' and includes the following methods and attributes: Method Name Purpose Input init Constructor sets initial values for al object See blowNone Displays a readable version of the Employee None object Employee data as a printable string str hourly rate Calculates and returns the employee's hourly None Hourly rate (float) rate of pay -divides salary by 2080 Returns the employee's current age in years Today's month - subtracts today's year from birth year, but int) and today's accounts for month differences (i.e. if birth year(int) month occurs before today's month, age is current year minus 1) age (int) minus birth year, otherwise that If age 65, returns True- employee is Today's month True or False eligible to retire. Otherwise, False can retire (int) and today's year(int) ID:"E+ 5 digits Employee name-"last name>, cfirst name>" Integer in range 1 to 12 Integer, 4 digits, range 1800 and above Is this a currently enrolled student?"y""n Annual salary: integer in range 0 to 1000000 empl num str str int int str Int birth month birth year job title salary Create several employee objects. Here's an example el - Employee(E34568, "David Miller, 1960, 3, 'Accountant, 65000) e2 -Employee('E22154', Margarete Smith, 1972, 10, Vice President, 115000) e3-Employee('E43344','Chase Smedley. 1982, 8, 'Salesman', 75000) e4 Employee('E12157, "Daniel Arledge, 1952, 11, Lawyer, 92000) Then print each object, the age of the employee, and their retirement eligibility. To create and test the Employee class do the following

Explanation / Answer

ScreenShot

Program

#Employee class creation
class Employee:
    #constructor
    def __init__(self,empl_num,name,birth_month,birth_year,job_title,salary):
        self.empl_num=empl_num
        self.name=name
        self.birth_Month=birth_month
        self.birth_year=birth_year
        self.job_title=job_title
        self.salary=salary
    #Function to calculate hourly pay
    def hourly_rate(self):
        return self.salary/2080
    #function to calculate age
    def age(self,month,year):
       # month=birth_Month-month
        if month<self.birth_Month:
            age=year-(self.birth_year)-1
            return age
        else:
            age=year-self.birth_year
            return age
    #function to calculate retirement status
    def can_retire(self,m,y):
        if(m<self.birth_Month):
            age=(y-birth_yearr)-1
        else:
            age=y-self.birth_year
        if(age>65):
            return True
        else:
            return False
    #to string method
    def __str__(self):
        template='{0.empl_num} {0.name} {0.birth_Month} {0.birth_year} {0.job_title} {0.salary}'
        return template.format(self)

#Main method or test method
def main():
#Instantiate an object
e1=Employee('E12345','Ashok',2,2000,'Lawyer',100000)
#Print using _str_
print(e1)
#display current age
print('Age=',e1.age(9,2018))
#Display current salary
print('Salary Per Hour=%.2f'%e1.hourly_rate())
#display current retirement status
print('Retirement status=',e1.can_retire(9,2018))
if __name__== "__main__":
main()

Output

E12345 Ashok 2 2000 Lawyer 100000
Age= 18
Salary Per Hour=48.08
Retirement status= False
Press any key to continue . . .