Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

// 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

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

Modern Dental Assisting

Authors: Doni Bird, Debbie Robinson

13th Edition

978-0323624855, 0323624855

Students also viewed these Programming questions

Question

Company case Creating a premium brand: the Audi success story

Answered: 1 week ago