Employee

public class Employee {

private int id;
private String name;
private double salary;
private double byPercent;

public Employee(int id,String name,double salary,double byPercent){
this.id = id;
this.name = name;
this.salary = salary;
this.byPercent = byPercent;
}

public int getId(){
return id;
}

public void setId(int id) {
this.id = id;
}

public String getName() {
return name;
}

public void setName(String name) {
this.name = name;
}


public double getSalary() {
return salary;
}


public void setSalary(double salary) {
this.salary = salary;
}


public double getByPercent() {
return byPercent;
}


public void setByPercent(double byPercent) {
this.byPercent = byPercent;
}

public double raiseSalary(){

return salary += salary * byPercent/100;
}

public static void main(String[] args) {
Employee e1 = new Employee(00001,"张三",1500,20);


System.out.println("编号"+" "+"员工"+" "+"基本工资"+" "+"增长率%"+" "+"总额");
System.out.println(e1.getId()+" "+e1.getName()+" "
+e1.getSalary()+" "+e1.getByPercent()+" "+ e1.raiseSalary());

}

}

相关文章:

  • 2022-02-25
  • 2022-12-23
  • 2021-11-30
  • 2021-12-31
  • 2022-02-24
  • 2022-12-23
  • 2021-07-07
  • 2021-06-26
猜你喜欢
  • 2021-10-04
  • 2022-12-23
  • 2022-01-23
  • 2022-12-23
  • 2022-02-11
  • 2022-02-02
  • 2022-12-23
相关资源
相似解决方案