Create a class Employee with basic_sal as its data member. Write a program to calculate the gross pay of an employee, with the allowances provided below.
Dearness Allowance = 21% of the Basic Pay
House Rent Allowance = 12% of Basic Pay
Provident Fund = 6.45% of Basic Pay
Net Pay = Basic Pay + Dearness Allowance + House Rent Allowance
Gross Pay = Net Pay − Provident Fund
Implement the program using the concept of Single Inheritance
Please someone help me with this program i am too frustrated solving this
public class Employee {
private double basicSal;
public Employee(double basicSal) {
this.basicSal = basicSal;
}
public double calculateGrossPay() {
return basicSal * 1.33 - basicSal * 0.0645;
}
}
Comments
Leave a comment