this.pay_rate = pay_rate; //. getter nethod public int getShift() return this.shift; // getter nethod of get pay rate public double getPayRate() //return the pay rate return this.pay_rate; //create main method public class Main public static void nain(String(] args) //create the object of the class Productionworker pw = new Productionworker ("914-A", new Date(), 1, 20.36); System.out.println("Enployee Nunber : " + pw.getEmployeeNumber()); System.out.println("Hiring Date : " + pw.gethiringDate()): System.out.println("Shift : " + pw.getShift()); System.out.println ("Payrate : " + pw.getPayRate());

Computer Networking: A Top-Down Approach (7th Edition)
7th Edition
ISBN:9780133594140
Author:James Kurose, Keith Ross
Publisher:James Kurose, Keith Ross
Chapter1: Computer Networks And The Internet
Section: Chapter Questions
Problem R1RQ: What is the difference between a host and an end system? List several different types of end...
icon
Related questions
Question

Please teach me how to fix an error from my JAVA source code.

I have set up the source code with class name "ProductionWorker" and there were a error occured on second page of sceenshot where it is highlighted. 

//import the file

import java.util.*;

//create the class

class Employee

{

//create the variable

private String emp_num;

//create the date variable

private Date hiring_date;

// default constructor

public Employee()

{

//assign the emp num.

this.emp_num = "000-A";

//assign the Date

this.hiring_date = new Date();

}

// constructor parameter

public Employee(String emp_num, Date hiring_date)

{

this.emp_num = emp_num;

this.hiring_date = hiring_date;

}

// getter method

public String getEmployeeNumber()

{

return this.emp_num;

}

// call the gethiringdate function

public Date gethiringDate()

{

// return the date

return this.hiring_date;

}

// setter method

public void setEmployeeNumber(String emp_num)

{

//set the emp num.

this.emp_num = emp_num;

}

//set the hiring date

public void sethiringDate(Date hiring_date)

{

//return the hiring date

this.hiring_date = hiring_date;

}

}

//extends the class Employee

class ProductionWorker extends Employee

{

//declare the vairable

private int shift;

private double pay_rate;

// constructor

public ProductionWorker()

{

// call the cinstructor of the super class

super();

this.shift = 1;

this.pay_rate = 0.0;

}

// constructor

public ProductionWorker(String emp_num, Date hiring_date, int shift, double pay_rate)

{

// call the cinstructor of the super class

super(emp_num, hiring_date);

this.shift = shift;

this.pay_rate = pay_rate;

}

// setter method

public void setShift(int shift)

{

//return the shift

this.shift = shift;

}

//create set pay rate

public void setPayRate(double pay_rate)

{

//return the pay rate

this.pay_rate = pay_rate;

}

// getter method

public int getShift()

{

return this.shift;

}

// getter method of get pay rate

public double getPayRate()

{

//return the pay rate

return this.pay_rate;

}

}

//create main method

public class Main

{

public static void main(String[] args)

{

//create the object of the class

ProductionWorker pw = new ProductionWorker("914-A", new Date(), 1, 20.36);

System.out.println("Employee Number : " + pw.getEmployeeNumber());

System.out.println("Hiring Date : " + pw.gethiringDate());

System.out.println("Shift : " + pw.getShift());

System.out.println("Payrate : " + pw.getPayRate());

}

}

//import the tile
import java.util.*;
//create the class
class Employee
//create the variable
private String emp_nun;
//create the date variable
private Date hiring date;
// default constructor
public Enployee()
//assign the emp num.
this.emp_nun = "000-A";
//assign the Date
this.hiring_date = new Date();
// constructor paraneter
public Enployee(String emp_nun, Date hiring_date)
this. emp_nun - emp_num;
this.hiring date = hiring_date;
// getter nethod
public String getEnmployeeNumber()
return this.emp_num;
// call the gethiringdate function
public Date gethiringDate()
// return the date
return this.hiring_date;
// setter nethod
public void setEmp loyeeNumber (String emp_num)
//set the enp num.
this.emp_nun - emp_num;
//set the hiring date
public void sethiringDate(Date hiring_date)
//return the hiring date
this.hiring_date = hiring_date;
//extends the class Enployee
class Productionworker extends Employee
//declare the vairable
private int shift;
private double pay_rate;
// constructor
public Productionworker()
// call the cinstructor of the super class
super();
this.shift = 1;
this.pay_rate = 0.0;
// constructor
public ProductionWorker(String emp_num, Date hiring_date, int shift, double pay_rate)
// call the cinstructor of the super class
super(emp_num, hiring date);
this.shift - shift;
this.pay_rate = pay_rate;
// setter nethod
public void setShift(int shift)
//return the shift
this.shift = shift;
//create set pay rate
public void setPayRate(double pay_rate)
//return the pay rate
Transcribed Image Text://import the tile import java.util.*; //create the class class Employee //create the variable private String emp_nun; //create the date variable private Date hiring date; // default constructor public Enployee() //assign the emp num. this.emp_nun = "000-A"; //assign the Date this.hiring_date = new Date(); // constructor paraneter public Enployee(String emp_nun, Date hiring_date) this. emp_nun - emp_num; this.hiring date = hiring_date; // getter nethod public String getEnmployeeNumber() return this.emp_num; // call the gethiringdate function public Date gethiringDate() // return the date return this.hiring_date; // setter nethod public void setEmp loyeeNumber (String emp_num) //set the enp num. this.emp_nun - emp_num; //set the hiring date public void sethiringDate(Date hiring_date) //return the hiring date this.hiring_date = hiring_date; //extends the class Enployee class Productionworker extends Employee //declare the vairable private int shift; private double pay_rate; // constructor public Productionworker() // call the cinstructor of the super class super(); this.shift = 1; this.pay_rate = 0.0; // constructor public ProductionWorker(String emp_num, Date hiring_date, int shift, double pay_rate) // call the cinstructor of the super class super(emp_num, hiring date); this.shift - shift; this.pay_rate = pay_rate; // setter nethod public void setShift(int shift) //return the shift this.shift = shift; //create set pay rate public void setPayRate(double pay_rate) //return the pay rate
this.pay_rate = pay_rate;
//. getter nethod
public int getShift()
return this.shift;
// getter nethod of get pay rate
public double getPayRate()
//return the pay rate
return this.pay_rate;
//create main method
public class Main
public static void nain(String(] args)
//create the object of the class
Productionworker pw = new Productionworker ("914-A", new Date(), 1, 20.36);
System.out.println ("Employee Number : " + pw.getEmployeeNumber ());
System.out.println("Hiring Date : " + pw.gethiringDate()):
System.out.println("Shift : " + pw.getShift());
System.out.println ("Payrate : " + pw.getPayRate());
Transcribed Image Text:this.pay_rate = pay_rate; //. getter nethod public int getShift() return this.shift; // getter nethod of get pay rate public double getPayRate() //return the pay rate return this.pay_rate; //create main method public class Main public static void nain(String(] args) //create the object of the class Productionworker pw = new Productionworker ("914-A", new Date(), 1, 20.36); System.out.println ("Employee Number : " + pw.getEmployeeNumber ()); System.out.println("Hiring Date : " + pw.gethiringDate()): System.out.println("Shift : " + pw.getShift()); System.out.println ("Payrate : " + pw.getPayRate());
Expert Solution
trending now

Trending now

This is a popular solution!

steps

Step by step

Solved in 2 steps with 1 images

Blurred answer
Recommended textbooks for you
Computer Networking: A Top-Down Approach (7th Edi…
Computer Networking: A Top-Down Approach (7th Edi…
Computer Engineering
ISBN:
9780133594140
Author:
James Kurose, Keith Ross
Publisher:
PEARSON
Computer Organization and Design MIPS Edition, Fi…
Computer Organization and Design MIPS Edition, Fi…
Computer Engineering
ISBN:
9780124077263
Author:
David A. Patterson, John L. Hennessy
Publisher:
Elsevier Science
Network+ Guide to Networks (MindTap Course List)
Network+ Guide to Networks (MindTap Course List)
Computer Engineering
ISBN:
9781337569330
Author:
Jill West, Tamara Dean, Jean Andrews
Publisher:
Cengage Learning
Concepts of Database Management
Concepts of Database Management
Computer Engineering
ISBN:
9781337093422
Author:
Joy L. Starks, Philip J. Pratt, Mary Z. Last
Publisher:
Cengage Learning
Prelude to Programming
Prelude to Programming
Computer Engineering
ISBN:
9780133750423
Author:
VENIT, Stewart
Publisher:
Pearson Education
Sc Business Data Communications and Networking, T…
Sc Business Data Communications and Networking, T…
Computer Engineering
ISBN:
9781119368830
Author:
FITZGERALD
Publisher:
WILEY