Problem: Employee and ProductionWorker Classes Write a python class named ProductionWorker that is a subclass of the Employee class. The ProductionWorker class should keep data attributes for the following information: • Shift number (an integer, such as 1, 2, or 3) • Hourly pay rate 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 shift 1 and the night shift is shift 2. Write the appropriate accessor and mutator methods for this class. Once you have written the class, write a program that creates an object of the ProductionWorker class, and prompts the user to enter data for each of the object’s data attributes. Store the data in the object, then use the object’s accessor methods to retrieve it and display it on the screen   Note: The program should be written in python.     Sample Input/Output: Enter the name: Ahmed Al-Ali Enter the ID number: 12345 Enter the department: IT Enter the job title: Programmer Enter the shift number: 1 Enter the hourly pay rate: 100 Production worker information: Name: Ahmed Al-Ali ID number: 12345 Department: IT Title: Programmer Shift: 1 Hourly Pay Rate: $100.00

Question

Problem: Employee and ProductionWorker Classes


Write a python class named ProductionWorker that is a subclass of the Employee class. The ProductionWorker class should keep data attributes for the following information:

• Shift number (an integer, such as 1, 2, or 3)
• Hourly pay rate
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 shift 1 and the night shift is shift 2. Write the appropriate accessor and mutator methods for this class. Once you have written the class, write a program that creates an object of the ProductionWorker class, and prompts the user to enter data for each of the object’s data attributes. Store the data in the object, then use the object’s accessor methods to retrieve it and display it on the screen

 

Note: The program should be written in python.

 

 

Sample Input/Output:


Enter the name: Ahmed Al-Ali
Enter the ID number: 12345
Enter the department: IT
Enter the job title: Programmer
Enter the shift number: 1
Enter the hourly pay rate: 100
Production worker information:
Name: Ahmed Al-Ali
ID number: 12345
Department: IT
Title: Programmer
Shift: 1
Hourly Pay Rate: $100.00

 

Expand

Expert Answer

Want to see the step-by-step answer?

Check out a sample Q&A here.

Want to see this answer and more?

Experts are waiting 24/7 to provide step-by-step solutions in as fast as 30 minutes!*

*Response times may vary by subject and question complexity. Median response time is 34 minutes for paid subscribers and may be longer for promotional offers.
Tagged in
Engineering
Computer Science

Python

Programing Language

Related Computer Science Q&A

Find answers to questions asked by students like you.

Q: Answer the question in the image below.

A: Constructor: A constructor is a special method of a class that has the same name as class name. Unli...

Q: In this homework assignment, you are going to code a java program which uses random numbers to creat...

A: Actually, the given program test cases are: The test cases for this program can be **user entering n...

Q: overload the rest of the operators, add to the code arithmetic operators (multiplication, division b...

A: #include <iostream> #include "point.hpp" using namespace std;   int main() {     point p1(10,1...

Q: See attached photo for prompt: a) Write a Python function called func_xy that takes values x and y a...

A: def func_xy(x,y):    if (x>=0 and y>=0):        return x+y    if (x>=0 and y<0):        ...

Q: Please help with the JAVA code

A: public class Quicksort{ public int partition(int arr[], int low, int high) { int pivot = arr[hi...

Q: Declare a string variable containing the name of your favorite color, initialize it as a null termin...

A: Actually, string is a sequence of characters.

Q: Write a c++ program to receive one integer value 'num' from user such that the number is greater tha...

A: #include<iostream> using namespace std; int main(){ //variable to store input int num;  //vari...

Q: #7 Push the value 6 to the following binary heap

A: Given array: { 4, 8, 5, 10, 14, 6, 7, 11, 13} Forming Min Heap from the array: Note: Since you are ...

Q: JAVA PROGRAM Write a program that asks the user to input two integers a and b. Then create an array...

A: public class Tester{   public static void main(String[] args){     int arr[];      //declare an arra...

Q: how can I describe the basic construction of a digital logic chip? Is digital logic chip same with l...

A: Note: According to the guidelines, we can answer only one question at a time. Please re-submit your ...

Q: please solve it by using FLOWCHART in VISUAL LOGIC : The student names and the grades for four test...

A: First of all, you need to have an array of strings to store names Then, you need to have for more ar...

Q: In C Programming Language using Switch statement

A: Please find the answer below :

Q: Focus on classes, objects, methods and good programming style. Program has to be written in basic py...

A: self is used to refer current instance random module contains randrange function used to generate ra...

Q: Consider the following AVR ATmega324A assembly language code segment and answer the questions below ...

A: Assembler programs are a little bit silly: the chip executes anything you tell it to do, and does no...

Q: 11.10 Create an ER diagram for each of the following descriptions:(a) Each company operates four dep...

A: Since you have asked multiple questions in a single request, we will be answering only the first que...

Q: subject (data structures) [print all increasing sequences of length k from first n natural numbers]...

A: A data structure is a particular way of organizing data in a computer so that it can be used effecti...

Q: Computer Science Question

A: SYNTAX The syntax for the query is as follows. SELECT column1, column2 FROM table1 ORDER BY column1 ...

Q: . Two quality characteristics that are critical fordata used in accounting for the management ofcomp...

A: Answer in step2

Q: Topic: Database

A: The entities along with attributes in the given UML are as follows. Room ( name, length, width ) Fur...

Q: What is the goal of Artificial Intelligence? State the different domains of it with two examples for...

A: Actually, Artificial Intelligence is a complex software  this is similar to human brains.

Q: a) List 4 valid expressions for the state machine shown in Figure 1. E.g., babc is a valid expressio...

A: 1. Valid Expression edded eddedd cbabc ddede edddde

Q: How to use printf to repeat a string in java?

A: printf itself can not repeat the strings in java. one needs to use loops to repeat the printing proc...

Q: Using java Hamburger ClassWrite a Hamburger class with the following six attributes:• bun - the type...

A: Actually, in the program given attributes are: Hamburger class with the following six attributes:• b...

Q: Please finish fast but accurate.Thank you!

A: Please find the answer below :  

Q: Programming Language: C++ Develop a Tic Tac Toe game that will match a player against the computer. ...

A: #include<bits/stdc++.h> using namespace std;   #define COMPUTER 1 #define HUMAN 2   #define SI...

Q: You are given an array called source, with length n, and a set of m arrays called target, each alsow...

A: int findmatch(){ int first =source[0]; for(int i=0;i<m;i++){ for(int j;j<n;j++){ if(target[j]=...

Q: please solve it by using FLOWCHART in VISUAL LOGIC : The student names and the grades for four test...

A: Initialize i to 0 Initialize student names in array of strings Initialize test1 marks in an array of...

Q: Assume a CPU has 8 registers (3 bits), 32 op-codes (5 bits), 15-bit addresses, 16-bit integers. Whic...

A: Introduction to register:   The registers store data elements for processing without having to acces...

Q: Using Java create a craps game prompting users to play bets, tracking win / lose records. keeping tr...

A: import java.util.*;import java.lang.*;import java.io.*;class Craps{ static int roll2Dice(Random...

Q: Explain the difference in the C memory model between global and local variables. How is each allocat...

A: Introduction of the Global and local variable in C: If we declare any variable inside the function i...

Q: 4. Define Memory space and Memory map. 5. Define Bus contention.

A: Actually, memory is used to stores the data.

Q: Discuss the possible data request scenarios in a distributed database environment.

A: Actually, distributed database is a distribute the data to different computers.

Q: #8 Perform a two deletions on the following binary heap. Enter the resultingheap and draw the heaped...

A: Given Array: {2, 3, 4, 8, 9, 12, 9, 10} Forming Min heap from the array: Note: Since your are not m...

Q: Write a program to overload the function call operator ( ) so as to allow the more common form of do...

A: Actually, program is executable software that runs on a computer.

Q: Please finish fast but accurate.Thank you!

A: Please find the answer below :

Q: Could someone rewrite this C++ code into C that would really help me along! #include using namespa...

A: Hi Student, this doesn't look like a complete code. I am not sure. so I have converted whatever you ...

Q: Explain the variations among a manager's ability to retrieve information immediately using a Managem...

A: Actually, management is the coordination and administration of tasks to achieve a goal.

Q: Explain why the code below does not run when using the test driver shown in screen shot. i also incl...

A: Java is an Object-Oriented Language. As a language that has the Object-Oriented feature, Java suppor...

Q: Because floating-point numbers are imprecise, it is common to compute data values of type float that...

A: The ask is to write a function countNZdata that counts number of elements in a list of type float wh...

Q: we studied arrays as an important data structure in Java. Discuss a situation and give an example fo...

A: Array is a collection of homogenous datatypes If there are 10 boxes containing different number of c...