Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Need this in PYTHON Write an Employee class that keeps data attributes for the following pieces of information: Employee name Employee number Parent Class: Employee

Need this in PYTHON image text in transcribed

Write an Employee class that keeps data attributes for the following pieces of information: Employee name Employee number Parent Class: Employee Class Next, write a class named ProductionWorker that is a subclass of the Employee class. The ProductionWorker class should keep data attributes (properties) for the following information: Shift number (an integer, such as 1, 2, or 3) Hourly pay rate Hours worked this week The workday is divided into two shifts: day and night. The shift attribute will hold an integer value representing the shift that the employee works. The day shift is 1 and the night shift is 2. Write the appropriate accessor and mutator methods for each class. Once you have written the classes, write a program that creates an object of the ProductionWorker and prompts the user to enter data for each of the object's data attributes. Use your validation class from HW7 to make sure the user enters valid values for pay rate and hours. Store the data in the object and then use the object's accessor methods to retrieve it and display it on the screen. You should also display this worker's total pay for the week. Total pay = hourly rate * hours worked. You may not do any calculations on the main file. This calculation MUST be performed on the ProductionWorker class, but do not store the total pay on the class, (i.e., you should NOT have a property for total pay.) Next, write a ShiftSupervisor class that is a separate subclass of the Employee class. Shift supervisors earn a salary and a yearly bonus if their shift meets production goals. A shift supervisor does not receive hourly wages. The ShiftSupervisor should keep a data attribute for the annual salary and a data attribute for the annual production bonus that a shift supervisor has earned. Write a second program that will create an object of the ShiftSupervisor and prompt the user to enter data for each of the object's data attributes. Use your validation class from HW7 to make sure the user enters valid values for annual salary and bonus. Store the data in the object and then use the object's accessor methods to retrieve it and display it on the screen. You should also display this supervisor's total annual pay. You may not do any calculations on the main file. Annual pay = salary + bonus. This calculation MUST be performed on the shiftSupervisor class. Store the annual pay on the class so it may be retrieved again

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored 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

Recommended Textbook for

Database Design Application Development And Administration

Authors: Mannino Michael

5th Edition

0983332401, 978-0983332404

More Books

Students also viewed these Databases questions

Question

What is Working Capital ? Explain its types.

Answered: 1 week ago