Write a programin Java to find the gross salary of an employee for the following allowances and deduction. Use meaningful variables with a class name employee and basic pay as an input
Dearness Allowance 25% of basic pay
House rent Allowance 15% of basic pay
Provident fund 8.33% of basic pay
Net pay-basic+dearness allowance house rent allowance Gross pay-Net pay- Provident fund
Answers
Answered by
24
Answer:
import java.util.*,
class basic
{
public static void main(String args[ ])
{
double bs,hra,da,gp,np,pf;
Scanner sc = new Scanner (System.in);
System.out.println("Enter the basic salary");
bs=sc.nextDouble();
da=0.25*bs;
hra=0.15*bs;
pf=0.0833*bs;
np=bs+da+hra;
gp=np-pf;
System.out.println("Gross pay" +gp);
System.out.println("Net pay" +np);
}
}
Similar questions