Answered step by step
Verified Expert Solution
Link Copied!

Question

00
1 Approved Answer

please code this in python The enhancements you are to add in this week's lab include: 1. Protect all attributes from direct dot notation access

please code this in python
image text in transcribed
image text in transcribed
The enhancements you are to add in this week's lab include: 1. Protect all attributes from direct "dot notation" access from outside the class. 2. Add accessor/mutator (getter/setter) methods to return or change the object's job_des and annual_salary - return the value for accessor methods and 'True' for successful mutator methods to indicate the required attribute has been updated 3. Add class level variables to hold integer values for the current year (2022,2023, etc.) and the current month (1,2,12) 4. Modify the 'age' and 'retire' methods to use the class level variables when computing an Employees age and retirement eligibility (note: 'retire' should retrieve the age from 'age', then compare it with 70 to determine eligibility) 5. Add an "equals" method (i.e. 'eqEmployee') to determine whether an input object is the same as the 'self' object. Equality is assumed when the object parameter is type 'Employee', and 'employee_id' and 'name' match. Return 'True' if the parameter object to be compared matches the 'self' (internal) object, otherwise return 'False'. Test if both objects are the same first: "if self == in_object" and immediately return 'True' if they are. In this assignment you are to enhance the Python program created in Lab \#2 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 this class to create some employee objects and test its methods. The name of the class is 'Employee' and includes the following methods and attributes (mostly repeated from last week's Lab hut nlease review the tables helow for chances)

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