Design a class named EmployeeRecord that holds an employees
Design a class named EmployeeRecord that holds an employee’s ID number, name, and payrate. Include mutator methods to set the values for each data field and output the values for each data field. Create the class diagram and write the code that defines the class and implements the mutator methods. need help please with this question
Solution
EmployeeRecord.java
public class EmployeeRecord {
private String name;
private int id;
private double payrate;
public EmployeeRecord(String name, int id){
this.name = name;
this.id = id;
}
public EmployeeRecord(){
}
public String getName() {
return name;
}
public void setName(String name) {
this.name = name;
}
public int getId() {
return id;
}
public void setId(int id) {
this.id = id;
}
public double getPayrate() {
return payrate;
}
public void setPayrate(double payrate) {
this.payrate = payrate;
}
public String toString(){
return \"Student ID: \"+id+\" Student Name: \"+name+\" Payrate: \"+payrate;
}
}
