Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

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

image text in transcribed

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 employee objects and test its methods. The name of the class is 'Employee' and includes the following methods and attributes Method Name Purpose Input Output/returns Constructor - sets initial values for all object |See below@None attributes nit Displays a readable version of the Employee object Calculates and returns the emplovee's hourlv rate of pav- divides salary by 2080 Returns the employee's current age in years |Today's - subtracts today's year from birth year, but month (int) accounts for month differences (i.e. if birth and today's month occurs before today's month, age is year(int) curren minus 1 If age > 65, returns 'True' - employee is eligible to retire. Otherwise, 'False None Employee data as a printable strin Hourly rate (float) hourly rate None age age (int) t year minus birth year, otherwise that Today's month (int) and today's can retire True or False ear(int) Attributel empl num name birth month birth vear ob title salai int int str int Definitioin ID: "E" 5 digits Employee name- Integer in range 1 to 12 Integer, 4 digits, range 1800 and above Description or title of the employee's job Annual salarv: integer in range 0 to 1000000 Create several employee objects. Here's an example el - Employee(E34568', David Miller', 3. 1996, 'Accountant', 65000) e2- Employee(E22154', 'Margarete Smith', 10, 1972, Vice President', 115000) e3-Employee('E43344', 'Chase Smedley, 8. 1988. 'Salesman', 75000) e4 Employee(E12157", 'Daniel Arledge', 11. 1952. Lawyer, 92000) Then print each object, the age of the employee, and their retirement eligibility

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access with AI-Powered Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Students also viewed these Databases questions