Computers and Technology

Modify the payroll system of Figs. 10.4-10.9 to include an additional Employee subclass Pieceworker that represents an employee whose pay is based on the number of pieces of merchandise produced. Class Pieceworker should contain private instance variables wage (to store the employee's wage per piece) and pieces (to store the number of pieces produced).
Provide a concrete implementation of method earnings in class Pieceworker that calculates the employee's earnings by multiplying the number of pieces produced by the wage per piece.
Create an array of Employee variables to store references to objects of each concrete class in the new Employee hierarchy. For each Employee, display its string representation and earnings.
Note: Here are the codes

// Fig. 10.8: .java
// class extends CommissionEmployee.
public class extends CommissionEmployee
{ private double baseSalary; // base salary per week
// six-argument constructor
public ( String first, String last,
String ssn, double sales, double rate, double salary )
{
super( first, last, ssn, sales, rate );
setBaseSalary( salary ); // validate and store base salary
} // end six-argument constructor

// set base salary
public void setBaseSalary( double salary )
{

answer
Answers: 2

Other questions on the subject: Computers and Technology

image
Computers and Technology, 22.06.2019 10:20, alcantar28eduin
Print "usernum1 is negative." if usernum1 is less than 0. end with newline. convert usernum2 to 0 if usernum2 is greater than 10. otherwise, print "usernum2 is less than or equal to 10.". end with newline
Answers: 3
image
Computers and Technology, 23.06.2019 03:00, SKYBLUE1015
What are the different parts of computer
Answers: 2
image
Computers and Technology, 24.06.2019 15:50, coralaguilar1702
Andy would like to create a bulleted list. how should he do this? andy should click on the bullet icon or select the bullet option from the menu and then type the list. andy should press the shift key and the 8 key at the beginning of each line of text. andy should type the text and then click on the bullet command. andy should press return and the bullets will automatically
Answers: 2
image
Computers and Technology, 26.06.2019 10:40, bmartinez26
Which type of ics facility is used to temporarily position and account for personnel, supplies, and equipment awaiting assignment? a. staging area b. incident command post c. incident base d. camp
Answers: 1
Do you know the correct answer?
Modify the payroll system of Figs. 10.4-10.9 to include an additional Employee subclass Pieceworker...

Questions in other subjects:

Konu
Mathematics, 06.02.2021 01:00