Answer to Question #303238 in Java | JSP | JSF for Aditi

Question #303238

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


1
Expert's answer
2022-02-28T16:21:38-0500
public class Employee {
    private double basicSal;

    public Employee(double basicSal) {
        this.basicSal = basicSal;
    }

    public double calculateGrossPay() {
        return basicSal * 1.33 - basicSal * 0.0645;
    }
}

Need a fast expert's response?

Submit order

and get a quick answer at the best price

for any assignment or question with DETAILED EXPLANATIONS!

Comments

No comments. Be the first!

Leave a comment

LATEST TUTORIALS
New on Blog
APPROVED BY CLIENTS