1.

Write a program by using class Employee to accept basic pay of an employee. Calculate the allowances/deductions using scanner as given below:Dearness Allowance (DA) = 30% of basic payHouse Rent Allowance (HRA) = 15% of basic payProvident Fund (PF) = 12.5% of basic payGross Pay = Basic Pay + DA + HRANet Pay = Gross Pay – PFFind and print the gross and net pay.

Answer»

Answer:

a PROGRAM in java:-

public CLASS employee

{

public static void main(double salary)

{

double allowance=30/100*salary;

double RENT =15/100*salary;

double pf=12.5/100*salary;

double gross=salary+allowance+rent;

double NET=salary-pf

System.out.println("gross pay=Rs."+gross);

System.out.println("net pay=Rs."+net)'

}

}

HOPING TO HELP YOU****



Discussion

No Comment Found