我没有得到想要的输出
我尝试了getter和setter方法,但无法实现所需的输出(下面列出)。
public void calculateNetSalary(int pfpercentage)
这是我的代码:
public class Employee {
private int employeeId;
private String employeeName;
private double salary;
private double netSalary;
public int getEmployeeId() {
return employeeId;
}
public double getNetSalary() {
return netSalary;
}
}
预期-------------->
Sample Input 1:
Enter Id:
101
Enter Name:
Vivek
Enter salary:
20000
Enter PF percentage:
7
Sample Output 1:
Id : 101
Name : Vivek
Salary : 20000.0
Net Salary : 18600.0