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 hypothetical 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:
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 hypothetical 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:
Database System Concepts
7th Edition
ISBN:9780078022159
Author:Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Publisher:Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Chapter1: Introduction
Section: Chapter Questions
Problem 1PE
Related questions
Concept explainers
OOPs
In today's technology-driven world, computer programming skills are in high demand. The object-oriented programming (OOP) approach is very much useful while designing and maintaining software programs. Object-oriented programming (OOP) is a basic programming paradigm that almost every developer has used at some stage in their career.
Constructor
The easiest way to think of a constructor in object-oriented programming (OOP) languages is:
Question
please follow the intstructions really need help

Transcribed Image Text: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 hypothetical 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
init
Constructor - sets initial values for all object See below@
None
attributes.
Displays a readable version of the Employee None
object
Employee data as a
printable string
str
Calculates and returns the employee's
hourly rate of pay – divides salary by 2080
hourly_rate
None
Hourly rate (float)
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
month occurs before today's month, age is
age
age (int)
and today's
year(int)
current year minus birth year, otherwise
that minus 1)
retire
If age > 70, returns 'True' – employee is
eligible to retire. Otherwise, 'False'
Today's
month (int)
and today's
year(int)
True or False
Attribute@
Туре
Definition
employee_id
str
ID: “E" + 5 digits
str
Employee name – “<last name>, <first name>"
name
birth_month
int
Integer in range 1 to 12
birth_year
int
Integer, 4 digits, range 1800 and above
job_des
str
Description or title of the employee's job
annual_salary
int
Annual salary: integer in range 0 to 1000000
In addition to the class definition, include the following global code that creates employee objects, prints those
objects, prints additional information on them using dot-notation access to attributes, and executes methods

Transcribed Image Text:to calculate other information about employees:
print('\nStart of Employee class demo')
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', 1959, 11, 'Lawyer', 92000)
e5 = Employee('E00001', 'Abe Lincoln', 1940, 2, 'Former POTUS', 10000)
print('el =', el)
print('e2 = ', e2)
print('e3 = ', e3)
print('e4 = ', e4)
print('e5 = ', e5)
print('Hourly rate for ', el.name, ' is ', el1.hourly_rate())
print('Age of ', e3.name, ' is ', e3.age(9, 2019))
print('Job description of ',e4.name,'is ',e4.job_des)
print('Retirement eligibility for ', e2.name, ' is ', e2.retire(9, 2019))
print('Retirement eligibility for ', e5.name, ' is', e5.retire(9, 2019))
print('\nEnd of Employee class demo')
Expert Solution

This question has been solved!
Explore an expertly crafted, step-by-step solution for a thorough understanding of key concepts.
This is a popular solution!
Trending now
This is a popular solution!
Step by step
Solved in 2 steps with 1 images

Follow-up Questions
Read through expert solutions to related follow-up questions below.
Knowledge Booster
Learn more about
Need a deep-dive on the concept behind this application? Look no further. Learn more about this topic, computer-science and related others by exploring similar questions and additional content below.Recommended textbooks for you

Database System Concepts
Computer Science
ISBN:
9780078022159
Author:
Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Publisher:
McGraw-Hill Education

Starting Out with Python (4th Edition)
Computer Science
ISBN:
9780134444321
Author:
Tony Gaddis
Publisher:
PEARSON

Digital Fundamentals (11th Edition)
Computer Science
ISBN:
9780132737968
Author:
Thomas L. Floyd
Publisher:
PEARSON

Database System Concepts
Computer Science
ISBN:
9780078022159
Author:
Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Publisher:
McGraw-Hill Education

Starting Out with Python (4th Edition)
Computer Science
ISBN:
9780134444321
Author:
Tony Gaddis
Publisher:
PEARSON

Digital Fundamentals (11th Edition)
Computer Science
ISBN:
9780132737968
Author:
Thomas L. Floyd
Publisher:
PEARSON

C How to Program (8th Edition)
Computer Science
ISBN:
9780133976892
Author:
Paul J. Deitel, Harvey Deitel
Publisher:
PEARSON

Database Systems: Design, Implementation, & Manag…
Computer Science
ISBN:
9781337627900
Author:
Carlos Coronel, Steven Morris
Publisher:
Cengage Learning

Programmable Logic Controllers
Computer Science
ISBN:
9780073373843
Author:
Frank D. Petruzella
Publisher:
McGraw-Hill Education