Write a Python class Employee with emp department and methods like print employee_details. www Sample Employee Data: like attributes like emp id, emp name, emp salary, and 4 calculate emp salary, emp assign department, calculate emp salary, "ADAMS", "E7876", 50000, "ACCOUNTING" "JONES", "E7499", 45000, "RESEARCH" "MARTIN", "E7900", 50000, "SALES" "SMITH", "E7698", 55000, "OPERATIONS" Use the 'assign department' method to change an employee's department. Use the 'print employee_details' method to print the details of an employee. and Using the 'calculate emp salary' method takes two arguments: salary and hours worked, which is the number of hours the employee works. If the number of hours worked is more than 50, the method computes overtime and adds it to the salary. Overtime is calculated as the following formula: overtime hours worked - 50 Overtime amount = (overtime * (salary / 50))

EBK JAVA PROGRAMMING
9th Edition
ISBN:9781337671385
Author:FARRELL
Publisher:FARRELL
Chapter10: Introduction To Inheritance
Section: Chapter Questions
Problem 14RQ
icon
Related questions
Question

answer should avoid using AI (such as ChatGPT), do not any answer directly copied from AI would and explain code

Write a Python class Employee with
emp department and methods like
print employee_details.
www
Sample Employee Data:
like
attributes like emp id, emp name, emp salary, and 4
calculate emp salary, emp assign department,
calculate emp salary,
"ADAMS", "E7876", 50000, "ACCOUNTING"
"JONES", "E7499", 45000, "RESEARCH"
"MARTIN", "E7900", 50000, "SALES"
"SMITH", "E7698", 55000, "OPERATIONS"
Use the 'assign department' method to change an employee's department.
Use the 'print employee_details' method to print the details of an employee.
and
Using the 'calculate emp salary' method takes two arguments: salary and hours worked, which is
the number of hours the employee works. If the number of hours worked is more than 50, the method
computes overtime and adds it to the salary. Overtime is calculated as the following formula:
overtime hours worked - 50
Overtime amount = (overtime * (salary / 50))
Transcribed Image Text:Write a Python class Employee with emp department and methods like print employee_details. www Sample Employee Data: like attributes like emp id, emp name, emp salary, and 4 calculate emp salary, emp assign department, calculate emp salary, "ADAMS", "E7876", 50000, "ACCOUNTING" "JONES", "E7499", 45000, "RESEARCH" "MARTIN", "E7900", 50000, "SALES" "SMITH", "E7698", 55000, "OPERATIONS" Use the 'assign department' method to change an employee's department. Use the 'print employee_details' method to print the details of an employee. and Using the 'calculate emp salary' method takes two arguments: salary and hours worked, which is the number of hours the employee works. If the number of hours worked is more than 50, the method computes overtime and adds it to the salary. Overtime is calculated as the following formula: overtime hours worked - 50 Overtime amount = (overtime * (salary / 50))
Expert Solution
steps

Step by step

Solved in 2 steps

Blurred answer
Similar questions
Recommended textbooks for you
EBK JAVA PROGRAMMING
EBK JAVA PROGRAMMING
Computer Science
ISBN:
9781337671385
Author:
FARRELL
Publisher:
CENGAGE LEARNING - CONSIGNMENT
C++ for Engineers and Scientists
C++ for Engineers and Scientists
Computer Science
ISBN:
9781133187844
Author:
Bronson, Gary J.
Publisher:
Course Technology Ptr
Microsoft Visual C#
Microsoft Visual C#
Computer Science
ISBN:
9781337102100
Author:
Joyce, Farrell.
Publisher:
Cengage Learning,
C++ Programming: From Problem Analysis to Program…
C++ Programming: From Problem Analysis to Program…
Computer Science
ISBN:
9781337102087
Author:
D. S. Malik
Publisher:
Cengage Learning
Programming Logic & Design Comprehensive
Programming Logic & Design Comprehensive
Computer Science
ISBN:
9781337669405
Author:
FARRELL
Publisher:
Cengage
Systems Architecture
Systems Architecture
Computer Science
ISBN:
9781305080195
Author:
Stephen D. Burd
Publisher:
Cengage Learning