Write an Employee class that keeps data attributes for the following pieces of information: (a). Employee name (b). Employee number Next, write a class named ProductionWorker that is a subclass of the Employee class. The ProductionWorker class should keep data attributes for the following information: (c). Shift number (an integer,such as1 for morning shift, 2 for evening shift) (d). Hourly payrate Write the appropriate accessor and mutator methods for each class.
Q: What is the output of the following code where Student is a subclass of Person class? Person s =…
A: The instanceof operator is used to test whether the object is an instance of the specified type…
Q: Write a java program named MyLoan that uses an abstract class named FamilyInsurance and subclasses…
A: The complete code is given below with the output.
Q: 4. In a restaurant, whenever customers visit, they are provided with items from two categories, one…
A: Answer: Algorithms 1.Given abstract class fixedCategory in this given bottle price and salad price…
Q: Write a java program that declares two classes. The parent class is called Simple that has two data…
A: code: public class JavaExample{ int add(int num1, int num2) { return num1+num2; }…
Q: Consider the classes shown below: public class Parent { private int value = 100; public int…
A: Inheritance is a mechanism in which one object acquires all the properties and behaviors of a parent…
Q: use the following partial class definitions: public class A1 { public int x; private int y; public…
A: subclass (child) - the class that inherits from another class superclass (parent) - the class being…
Q: Create an abstract class called Employee that has an abstract method called calculatePay() which…
A: Note :- You have not mention the language of the program, So I am doing your question in Java. Your…
Q: Define a class for complex numbers. A complex number is a number of the form a + b*i where for our…
A: #include<bits/stdc++.h>using namespace std; class Complex{ // attributes public: double…
Q: 1. Create an abstract class that stores data about the shapes e.g. Number of Lines in a Shape, Pen…
A: the code is given below :
Q: 1. Write a simple information system that will store and display the complete information of a…
A: declaring instance variables setters and gettersdeclaring instance variablessetters and getters…
Q: Take this the Java Gringrots problem below turn it into a running program. where the main…
A: Solution: Given, This Java class has a main, and the following protected member functions:…
Q: 4. In a restaurant, whenever customers visit, they are provided with items from two categories, one…
A: import java.util.*; //defining abstract class abstract class fixedCategory{ double…
Q: Java program: 1. Write a superclass called Animal with the following: Private Fields:…
A: Animal.java ==================== public class Animal { //declaring variables private boolean…
Q: Write a java program to create a class named shape. In this class we have three sub classes sphere,…
A: Write a java program to create a class named shape. In this class we have three sub classes sphere,…
Q: write a python code: Create a subclass Cylinder that is derived from the super class…
A: Super class is the class which is being inherited. Subclass is the class that inherits from another…
Q: We discussed in the class that during the design, you may need a class that serves as an interface…
A: Please find the code and output below
Q: Build an abstract class named Salary that has the following: -One abstract method named…
A: Code: abstract class Salary{ abstract void calculateSalary(); void MinimumSalary() {…
Q: Programming Launguage = Python 2. ShiftSupervisor Class In a particular factory, a shift…
A: class Shiftsupervisor:#Initialize the Shiftsupervisor attributes def __init__(self, salary,…
Q: Write an Employee class that keeps data attributes for the following pieces of information: •…
A: public class Employee { // declaring instance variables private String employeeName; private int…
Q: Programming Language = Python 1. Employee and ProductionWorker Classes Write an Employee class…
A: Programming Approach: Defining a class Employee. Defining the _init_ method. Defining method…
Q: Write the PYTHON Programs for the following exercises
A: Two questions are asked therefore only the first question will be answered. Please upload another…
Q: In java Create an abstract super class called Employee with the following attributes: name :…
A: Hey there, I am writing the required solution based on the above given question. Please do find the…
Q: Define the following classes to manage the booking of patients in a medical clinic. a) Define a…
A: Note:- As per policy, only the first three parts are answered. Please repost the question by…
Q: Write a program that defines a class Employce with the following members as shown in the bellow UML…
A: print method will print all the information like name, id, salary
Q: Write a Java programs to: 1. 1. Create a class called Student with four (4) private member…
A: GIVEN: Create a class called students with 4 private member variables, name quiz midterm, and…
Q: Employee and ProductionWorker Classes Write an Employee class that keeps data attributes for the…
A: Hey! You have asked multiple questions in a single request. As per policy, First Question is…
Q: using c++: Write a class service (servant_name, tip, and the static total_tip and static…
A: /******************************************************************************…
Q: Ex: If the input is: The Hobbit J. R. R. Tolkien George Allen & Unwin 21 September 1937 The…
A: So i have completed the program in python as per my understanding after seeing the reference code.…
Q: Assignment: Write the class XXXX_Worker with constructors, accessors, mutuators, and a toString…
A: create XXXX_Worker class with instance data members as Worker Name and Number.declare constructors,…
Q: You can access this function from main() and display the string “Oversize” for oversize books and…
A: import java.time.LocalDate; public abstract class Publication{ //declare the fields…
Q: In C++ Define a class named Complex that will represent complex numbers. A complex number is a…
A: The required C++ program code is given below: #include <iostream>using namespace std; class…
Q: 1.2 The class Notebook has the following instance data: • Brand name – example: Acer, Dell, Lenovo…
A: class Notebook { //Variables of Notebook Class String brandname,itemcode; double…
Q: Write a program using inheritance to do the following tasks: a) Create an abstract class Employee…
A: Code provided below contains - Employee and EmployeeTax class. Driver code to test the program.…
Q: The BankAccount class described below is used to represent a personal savings account with a yearly…
A: class BankAccount { public BankAccount(double rate) { this.intRate = rate; }…
Q: Suppose, we have two related (child) classes named Doctor and Patient. Data members required by each…
A: As you have not mentioned the programming language to be used but description is showing that you…
Q: bstract methods calculateArea() and calculateCircumference(). Both return doubles representing the…
A: In This we need to define the Shape ,Circle,Rectangle and Triangle classes as per the given…
Q: Write a program (read and print information) that simulates the three classes defined as shown…
A: Inheritance is a concept in which one class acquires the properties of another class. An inheriting…
Q: Write a program in java for the following scenario and write a DriverQ class to test your…
A: Find the required code in java given as below and output :
Q: Suppose in Islamabad International Airport the plans arrivals and departures are frequent and they…
A: Program code: //C++ program to computes the kinetic energy#include <iostream>using namespace…
Q: In Python 3, create a parent class named Machine and a child class named PollMachine. Have methods…
A: class Machine: def __init__(self,a,b,c,n): self.a_count=a self.b_count=b…
Q: write a java programme: Vehicle class: First create an abstract Vehicle class that contains code…
A: To write a java program for given scenario which hold methods like class and interfaces. An…
Q: Write a Program to define a Television class, with member variables o String brandName; o String…
A: In Step 2, you will get the java code. In Step 3, you can see the output.
Q: Given the base class Book, define a derived class called Encyclopedia. Within the derived…
A: 1) Below is updated program that define a derived class called Encyclopedia. Within the derived…
Q: 2. A software firm has mainly two types of employces: Fulltime employees get basic pay, medical…
A: Hey there, I am writing the required solution of the above stated question.Please do find the…
Q: Create a program that exhibits inheritance. Software Requirements: • Latest version of NetBeans IDE…
A: Inheritance: One class acquiring the properties of another class is called inheritance. Types of…
Q: Design a Class Customerinsurance that implements Customer and Insurance interfaces, The Customer…
A: An interface in Java is a blueprint of a class. All the methods in an interface are abstract All the…
Q: Using python write a program that contains 1. a class named information that has the following…
A: You asked for the Mutator method and also create an instance that holds your information. Both do…
Q: IN C++, Create a class called Invoice that a hardware store might use to represent an invoice for an…
A: Question given: Create a class for get invoice of a hardware items. Class has four instance…
Python
3. Write an Employee class that keeps data attributes for the following pieces of
information:
(a). Employee name
(b). Employee number
Next, write a class named ProductionWorker that is a subclass of the Employee class.
The ProductionWorker class should keep data attributes for the following information:
(c). Shift number (an integer,such as1 for morning shift, 2 for evening shift)
(d). Hourly payrate
Write the appropriate accessor and mutator methods for each class.
Trending now
This is a popular solution!
Step by step
Solved in 3 steps with 1 images
- Please write in Python with comments 2. ShiftSupervisor ClassIn a particular factory, a shift supervisor is a salaried employee who supervises a shift. In addition to a salary, the shift supervisor earns a yearly bonus when his or her shift meets production goals. Write a ShiftSupervisor class that is a subclass of the Employee class you created in Programming Exercise 1. The ShiftSupervisor class should keep a data attribute for the annual salary, and a data attribute for the annual production bonus that a shift supervisor has earned. Demonstrate the class by writing a program that uses a ShiftSupervisor object.Programming Language = Python 1. Employee and ProductionWorker Classes Write an Employee class that keeps data attributes for the following pieces of information: • Employee name • Employee number Next, write a 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 each class. Once you have written the classes, 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 and then use the object’s accessor methods to retrieve it and display it on the…In Java, Write a line of code that performs each of the following tasks : (a) Call superclass Employee's toString method from subclass Pieceworker's toString method. (b)Specify that class Pieceworker inherits from class Employee. (c) Call superclass Employee's constructor from subclass Pieceworker's constructor - assume that the superclass constructor receives three strings representing the first name, last name and social security number.
- Write a class named Person with data attributes for a person’s name, address, and telephone number. Next, write a class named Customer that is a subclass of the Person class. The Customer class should have a data attribute for a customer number and a Boolean data attribute indicating whether the customer wishes to be on a mailing list. Demonstratean instance of the Customer class in a simple program.Define a class for complex numbers. A complex number is a number of the form a + b*i where for our purposes, a and b are numbers of type double, and i is a number that represents the quantity √-1. Represent a complex number as two values of type double. Name the member variables real and imaginary. (The variable for the number that is multiplied by i is the one called imaginary.) Call the class Complex. Include a constructor with two parameters of type double that can be used to set the member variables of an object to any values. Include a constructor that has only a single parameter of type double; call this parameter realPart and define the constructor so that the object will be initialized to realPart + 0*i.Include a default constructor that initializes an object to 0 (that is, to 0 + 0*i).Overload all the following operators so that they correctly apply to the type Complex: ==, +, −, *, >>, and <<. You should also write a test program to test your class. Hints: To add…IN C++, Create a class called Invoice that a hardware store might use to represent an invoice for an item sold at the store. An Invoice should include four pieces of information as instance variables - a part number (type String), a part description (type String), a quantity of the item being purchased (type int) and a price per item (double). Your class should have a constructor that initializes the four instance variables. Provide a set and a get method for each instance variable. In addition, provide a method named getInvoiceAmount that calculates the invoice amount (i.e., multiplies the quantity by the price per item), then returns the amount as a double value. If the quantity is not positive, it should be set to 0. If the price per item is not positive, it should be set to0. Write a test app named InvoiceTest that demonstrates class Invoice's capabilities.
- Write a Python Program A smart AC is a subclass of AC class, which relates to the Appliance superclass. The appliance class contains three private instance variables: brand name, model no, power consumption, and one method Specification(). The AC class has the following fields and methods: warranty, price, discuent, Discuent_Price(). The SmartAC class has the following fields and methods: warranty, price, discount, Regular_price(), Discount_Price().Now perform the Followings: 1. Create an instance of the Appliance class and initialize all the fields with appropriate values. Show a specification on any instance. 2. Create two instances of the smart AC class and initialize all the fields with appropriate values. Show the operation of Regular_Price() and Discount_Price() method for both. Take the discount amount as user input.Assignment: Write the class XXXX_Worker with constructors, accessors, mutuators, and a toString method. A Worker has a Worker Name and Number. Write the class XXXX_ProductionWorker which is a subclass of Worker. The production worker has a shift number (values: 1 or 2) and an Hourly pay rate. A shift number of 1 means the day shift and 2 means the night shift. Write the class XXXX_ShiftSupervisor which is a subclass of Worker. The shift supervisor is a salaried worker who supervises a shift. The shift supervisor has a yearly bonus field. The yearly bonus is earned at year end based on performance. Write a class, XXXX_TestWorker, which does the following: Creates one Shift Supervisor object from information entered by the user. Creates an Array of Production Workers that can hold 3 objects. Itcreates3ProductionWorkerobjectsfrominformationenteredbytheuser Prints the information about each object in the format shown below using the toString methods of the…Write a Java program: In the board game Scrabble, each tile contains a letter, which is used to spell words in rows and columns, and a score, which is used to determine the value of words. The point of this exercise is to practice the mechanical part of creating a new class definition: Write a definition for a class named Tile that represents Scrabble tiles. The instance variables should be a character named "letter" and an integer named "value". Write a constructor that takes parameters named letter and value, and initializes the instance variables. Create getters for both of the attributes. (No setters, so that a Tile is immutable.) Implement the .toString() and .equals methods for a Tile.
- Step-1 Imagine a Car Parts and Accessories shop, which requires a software system to keep track of stock items and prices. The shop will sell different kinds of stock items. However, to start with, you have been tasked with designing and implementing a class called StockItem with the following properties. An instance (object) of the StockItem class represents a particular item which the shop sells, with a string representing fixed stock code, an integer representing variable quantity in stock and a double representing variable price of the stocked item. All these variables should be declared as private variables. The StockItemclass also contains a class variable (shared by all instances) of type string representing stock category which you can initialise as 'Car accessories'. A constructor that creates a Stock Item with the specified quantity, price and the stock code. All the appropriate ‘setters’ and ‘getters’ methods, including a getStockName() method which returns the string…Design a Class Customerinsurance that implements Customer and Insurance interfaces, The Customer Class has the customers' details and abstract functions getoustomer().setCustomer(). The Insurance interface has the details of policy name, yearly premium amount and abstract functions get getpolicy(), Setpolicy() The Customer insurance class get the policy name payment type (quartery, hall yearly, yearly) of the customer and calculate the policy amount to be paid Write only in JavaIn Python 3, create a parent class named Machine and a child class named PollMachine. Have methods to clear the machine state, to agree or disagree with 3 polling questions of your choice, get tallies of all the agrees and disagrees for each answer, and display the results once the poll is ended (these methods can go in whichever class). Keep asking users to enter answers until the user ends the program. The program should use inheritance, so there should be a parent class and a child class.