write a program in 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 as input.
Dearness allowance : 25% of basic pay.
House rent allowance : 15% of basic pay.
provident fund : Basic pay + Dearness allowance + House rent allowance.
Gross pay : Net pay - Provident fund.
Answers
Answer:
import java.util.*;
public class Main
{
public static void main(String[] args) {
Scanner in = new Scanner(System.in);
double dearness_allowance=25;
double house_rent_allowance=15;
System.out.print("Enter Basic Pay:");
double basic_pay=in.nextDouble();
double cal_dearness=(basic_pay*dearness_allowance)/100;
System.out.println("Dearness Allowance: "+cal_dearness);
double cal_house_rent=(basic_pay*house_rent_allowance)/100;
System.out.println("House Allowance: "+cal_house_rent);
double cal_provident=basic_pay+cal_dearness+cal_house_rent;
System.out.println("Provident fund: "+cal_provident);
double grosspay=basic_pay-cal_provident;
System.out.println("Gross pay: "+ grosspay );
}
}
Explanation:
Gross pay might be wrong. i didnt understand netpay .. you can change it.
Answer:
here is ur answer
Explanation:
Class question 9