1.

Write a class with name employee and basic as its data members, to find the gross pay of an employee of the following allowances and deductions DA = 25% of basic payHRA = 15% of basic payPF = 8.33% of basic payNet Pay = Basic pay + DA + HRAGross Pay = Net Pay – PF

Answer»

import jave.i0.*; 

public class employee

{

public static void main (string args [ ]) throws IO Exception

{

int basic; double bra da, pf, n pay,gross;

gross = 0

Input Stream Reader read = new Input Stream Reader (System.in);

Buffered Reader in = new Buffered Reader (read); 

System.out.printIn (“Enter basic salary”);

basic = Integer.parseInt (in.read Line ( ));

da = basic * 25/100

hra = basic * 15/100

pf = basic * 8.33/100;

npay = da + hra + basics; gross = npay – pf; 

System.out.printIn (“The net pay =” + npay); 

System.out.printIn (“The gross pay =” + gross);

}

}



Discussion

No Comment Found

Related InterviewSolutions