i have written the first question, please follow the way of my first question /* Employee class */ public class Employee { public int EmployeeID; public String EmployeeName; public double salary; public Employee() { } public Employee(int EmployeeID, String EmployeeName, double salary) { this.EmployeeID = EmployeeID; this.EmployeeName = EmployeeName; this.salary = salary; } public void display(){ System.out.println("The Employee ID is "+EmployeeID); System.out.println("The Employee Name is "+EmployeeName); System.out.println("The Employee salary is "+salary); } public double computerSal(double bonus){ double totalSal = salary + bonus; return totalSal; } public int getEmployeeID() { return EmployeeID; } public void setEmployeeID(int EmployeeID) { this.EmployeeID = EmployeeID; } public String getEmployeeName() { return EmployeeName; } public void setEmployeeName(String EmployeeName) { this.EmployeeName = EmployeeName; } public double getSalary() { return salary; } public void setSalary(double salary) { this.salary = salary; } }
i have written the first question, please follow the way of my first question
/*
Employee class
*/
public class Employee {
public int EmployeeID;
public String EmployeeName;
public double salary;
public Employee() {
}
public Employee(int EmployeeID, String EmployeeName, double salary) {
this.EmployeeID = EmployeeID;
this.EmployeeName = EmployeeName;
this.salary = salary;
}
public void display(){
System.out.println("The Employee ID is "+EmployeeID);
System.out.println("The Employee Name is "+EmployeeName);
System.out.println("The Employee salary is "+salary);
}
public double computerSal(double bonus){
double totalSal = salary + bonus;
return totalSal;
}
public int getEmployeeID() {
return EmployeeID;
}
public void setEmployeeID(int EmployeeID) {
this.EmployeeID = EmployeeID;
}
public String getEmployeeName() {
return EmployeeName;
}
public void setEmployeeName(String EmployeeName) {
this.EmployeeName = EmployeeName;
}
public double getSalary() {
return salary;
}
public void setSalary(double salary) {
this.salary = salary;
}
}
Step by step
Solved in 2 steps with 2 images