Question: // Problem 1: PieceWorker.java // PieceWorker class extends Employee. public class PieceWorker extends Employee { /* declare instance variable wage */ /* declare instance variable

// Problem 1: PieceWorker.java

// PieceWorker class extends Employee.

public class PieceWorker extends Employee

{

/* declare instance variable wage */

/* declare instance variable pieces */

// five-argument constructor

public PieceWorker( String first, String last, String ssn,

double wagePerPiece, int piecesProduced )

{

/* write code to initialize a PieceWorker */

} // end five-argument PieceWorker constructor

// set wage

/* Develop a set method that validates and sets the PieceWorker's wage */

// return wage

/* Develop a get method that returns the PieceWorker's wage */

// set pieces produced

/* Develop a set method that validates and sets the number of pieces produced */

// return pieces produced

/* Develop a get method that returns the number of pieces produced */

// calculate earnings; override abstract method earnings in Employee

public double earnings()

{

/* write code to return the earnings for a PieceWorker */

} // end method earnings

// return String representation of PieceWorker object

public String toString()

{

/* write code to return a string representation of a PieceWorker */

} // end method toString

} // end class PieceWorker

When i run this program above i get the error code below. Can you please identify the problem?

PieceWorker.java:12: error: constructor Employee in class Employee cannot be applied to given types;

{

^

required: String,String,String

found:no arguments

reason: actual and formal argument lists differ in length

1 error

----jGRASP wedge2: exit code for process is 1.

----jGRASP: operation complete.

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Programming Questions!