Academic Integrity: tutoring, explanations, and feedback — we don’t complete graded work or submit on a student’s behalf.

Fill in the template below to make a class definition for a class that describes

ID: 3888833 • Letter: F

Question

Fill in the template below to make a class definition for a class that describes an employee. For each method given you must provide the method header with the appropriate implementation, return type and parameters. For each variable, you must select an appropriate name and type. Make sure your code conforms to the instructions given in the comments for each method. 2. public class Employee II variable holds 20 char for lastname private String private private, I/ variable holds the first name : II variable holds a 8 digit employee ID number : II variable holds a salary public // Constructor that uses two parameters. The first last name /1 and the second the first name and they cannot be later changed. // The salary and employee ID number should be set to zero public // This method return a string with the last name of the employee public // This method takes an integer and assigns it to the employee ID number public // This method takes a double value to set the employee salary

Explanation / Answer

Answer:

public class Employee {

private String lastName;

private String firstName;

private int employeeId;

private double salary;

public Employee(String firstName, String lastName) {

this.firstName = firstName;

this.lastName = lastName;

this.employeeId=0;

this.salary=0;

}

public String getLastName() {

return lastName;

}

public void setEmployeeId(int employeeId) {

this.employeeId = employeeId;

}

public void setSalary(double salary) {

this.salary = salary;

}

}

Hire Me For All Your Tutoring Needs
Integrity-first tutoring: clear explanations, guidance, and feedback.
Drop an Email at
drjack9650@gmail.com
Chat Now And Get Quote