WAP to input employee code, name
and basic salary of an employee and calculate the following values:
HRA 40
% of basic salary
DA 10
% of basic salary
CCA 5
% of basic salary
GS Basic
+ HRA + DA + CCA
PF 10
% of GS
IT 10
% of GS
NS GS
– (PF + IT)
--------------------------------------------------------------------------------------------------------------------------
import java.util.*;
class empcode{
public static void main(String [] args){
double hra,da,cca,gs,pf,it,ns,bs;
String ename;
int enu;
Scanner inp =new Scanner(System.in);
System.out.println("Enter code");
enu=inp.nextInt();
System.out.println("Enter name");
ename=inp.next();
System.out.println("Enter basic salary");
bs=inp.nextDouble();
hra=(bs*40/100);
da=(bs*10/100);
cca=(bs*5/100);
gs=(bs+hra+da+cca);
pf=(gs*10/100);
it=(gs*10/100);
ns=(gs-(pf-it));
System.out.println("basic salary= "+bs);
System.out.println("hra= "+hra);
System.out.println("da= "+da);
System.out.println("cca= "+cca);
System.out.println("gs= "+gs);
System.out.println("pf= "+pf);
System.out.println("it= "+it);
System.out.println("ns= "+ns);
}
}
No comments:
Post a Comment