import java.io.*;
import java.util.*;
import java.io.IOException.*;
public class payslip
{
public static void main (String[] args)
{
String name;
double basic,DA,HRA,LIC,PF,ALL,DED,GP;
Scanner in = new Scanner(System.in);
System.out.println("Enter Name : ");
name = in.nextLine();
System.out.println("Enter Basic : ");
basic = in.nextInt();
DA = basic*(5.0/100.0);
HRA = basic*(12.0/100.0);
LIC = basic*(8.0/100.0);
PF = basic*(12.0/100.0);
ALL = DA + HRA;
DED = LIC + PF;
GP=(basic+ALL)-DED;
System.out.println("\t\t\tPAY SLIP");
System.out.println("\tName : "+name);
System.out.println("\tBasic : "+basic);
System.out.println("\tDA : "+DA);
System.out.println("\tHRA : "+HRA);
System.out.println("\tLIC : "+LIC);
System.out.println("\tPF : "+PF);
System.out.println("\tAllowance : "+ALL);
System.out.println("\tDeduction : "+DED);
System.out.println("\tGross Profit : "+GP);
}
}
OUTPUT:
import java.util.*;
import java.io.IOException.*;
public class payslip
{
public static void main (String[] args)
{
String name;
double basic,DA,HRA,LIC,PF,ALL,DED,GP;
Scanner in = new Scanner(System.in);
System.out.println("Enter Name : ");
name = in.nextLine();
System.out.println("Enter Basic : ");
basic = in.nextInt();
DA = basic*(5.0/100.0);
HRA = basic*(12.0/100.0);
LIC = basic*(8.0/100.0);
PF = basic*(12.0/100.0);
ALL = DA + HRA;
DED = LIC + PF;
GP=(basic+ALL)-DED;
System.out.println("\t\t\tPAY SLIP");
System.out.println("\tName : "+name);
System.out.println("\tBasic : "+basic);
System.out.println("\tDA : "+DA);
System.out.println("\tHRA : "+HRA);
System.out.println("\tLIC : "+LIC);
System.out.println("\tPF : "+PF);
System.out.println("\tAllowance : "+ALL);
System.out.println("\tDeduction : "+DED);
System.out.println("\tGross Profit : "+GP);
}
}
OUTPUT:
No comments:
Post a Comment