Write a program in python to enter employee name and basic salary. Find the gross pay of an
employee for the following allowances and deductions.
Gross Pay Basic Salary + DearnessAllowance +House Rent Allowance
Net Pay Gross Pay – Provident Fund
Answers
Answer:
Allowance / Deduction Rate
Dearness Allowance (DA) 30% of Basic Pay
House Rent Allowance (HRA) 15% of Basic Pay
Provident Fund (PF) 12.5% of Basic Pay
Finally, find and print the Gross and Net pay.
Gross Pay = Basic Pay + Dearness Allowance + House Rent Allowance
Net Pay = Gross Pay - Provident Fund
Java
Input in Java
ICSE
import java.util.Scanner;
public class Employee
{
public static void main(String args[]) {
Scanner in = new Scanner(System.in);
System.out.print("Enter Basic Pay: ");
double bp = in.nextDouble();
double da = 0.3 * bp;
double hra = 0.15 * bp;
double pf = 0.125 * bp;
double gp = bp + da + hra;
double np = gp - pf;
System.out.println("Gross Pay = " + gp);
System.out.println("Net Pay = " + np);
}
}