Payroll Management System in java


  • This following program does not contain graphics . This payroll system will work in command prompt or in any java editor.


PROGRAM :


import java.util.Scanner;
public class Payroll {
        
    public static void main(String[] args) {
       
        
   System.out.println("WELCOME TO PAYROLL MANAGEMENT SYSTEM");


    int employeeid,basic,month,i,h,z=0,j;
    double hra,con,med,lta,tot,pf,sal,tds,lic,basic1;
     String name, address;
     Scanner s =new Scanner (System.in);
     System.out.println("Enter the name of employee");
      name= s.next();
      System.out.println("Enter the address of the employee");
      address = s.next();
       System.out.println("enter the employee id");
       employeeid = s.nextInt();
      System.out.println("enter the basic salary of the employee");
      basic= s.nextInt();
     System.out.println("enter the working days of employee in form of month number from 1 to 12");
         month= s.nextInt();
         System.out.println("Enter the value LIC taken by employee:");
         lic= s.nextDouble();
         
         System.out.println("---------------------- REPORT-----------------");
        
         System.out.println("1. ATTENDANCE CHART");
         System.out.println("2. EMPLOYEE DETAILS");
         System.out.println("3. TOTAL ALLOWANCES");
         System.out.println("4. TOTAL DEDUCTION");
         System.out.println("5. MONTHLY SALARY STATEMENT");
         System.out.println("ENTER YOUR CHOICE");
         i= s.nextInt();
         switch(i)
         {
          case 1:
          System.out.println("--------ATTENDANCE CHART---------");
          System.out.println("enter the number of holidays taken by the employee");
          h=s.nextInt();
         if(month==1 || month==3 || month==5||month==7||month==8||month==10||month==12)
          {
          z= 31-h;
          System.out.println("total number of working days were :31");
          System.out.println("employee working days are:" +z);
         
          }
          else if(month==2) {
          z=28-h;
          System.out.println("total number of working days were :28");
          System.out.println("employee working days are:" +z);
          }
          else if(month==4 || month==6 || month==9||month==11){
          z=30-h;
          System.out.println("total number of working days were :30");
          System.out.println("employee working days are:" +z);
          }
          break;
         
          case 2:
                System.out.println("--------EMPLOYEE DETAILS---------");
                System.out.println("Employee ID =" +employeeid);
                System.out.println("Employee name="+name);
                System.out.println("Employee Address="+address);
                System.out.println("Employee working days=26");
                break;
               
           case 3:
              System.out.println("--------TOTAL ALLOWANCE---------");
              System.out.println("Enter the value LIC taken by employee:");
              lic= s.nextDouble();
              System.out.println("Employee id="+employeeid);
              System.out.println("Employee name = "+name);
              System.out.println("BASIC SALARY = "+basic);
              hra = basic * 0.18;
              System.out.println("HRA = "+hra);
              con= basic * 0.10;
              System.out.println(" DA = "+con);
              med = basic*0.15;
              System.out.println(" TA = "+med);
              lta= basic * 0.0175;
              System.out.println(" ESIC = "+lta);
              pf = basic * 0.125;
              System.out.println(" PF = "+pf);
              tot= basic+hra+con+med+lta-pf-lic;
              System.out.println("TOTAL SALARY = "+tot);
              break;
             
          case 4 :
            System.out.println("-------- TAX DEDUCTIONS---------");
            hra = basic * 0.18;
             
                con= basic * 0.10;
             
              med = basic*0.15;
             
              lta= basic * 0.0175;
             
              pf = basic * 0.125;
             
              tot= basic+hra+con+med+lta;
              sal = tot*12;
             if(sal<= 250000)
             {
              System.out.println("NO TAX DEDUCTION");
              }
              else if(sal>= 250000 && sal<= 500000)
              {
              tds= sal*0.05;
              System.out.println(" TAX DEDUCTION ANUALLY = "+tds);
             
              }
              else if(sal>=500000 && sal<=1000000)
              {
              tds = sal*0.10;
              System.out.println(" TAX DEDUCTION ANNUALY = "+tds);
              }
              else if(sal>=1000000)
              {
              tds=sal *0.30;
              System.out.println(" TAX DEDUCTION ANNUALY is = "+tds);
              }
              break;
             
                case 5 :
              System.out.println("----------MONTHLY SALARY STATEMENT---------");
              System.out.println("1. EMPLOYEE WISE");
              System.out.println("2. TOTAL EMPLOYEE STATEMENT");
              System.out.println("Enter your choice:");
              j=s.nextInt();
              switch(j)
              {
              case 1:
              System.out.println("//////-- EMPLOYEE WISE--//////");
              System.out.println(" PAYSLIP ");
              System.out.println("enter the number of holidays taken by the employee");
          h=s.nextInt();
          if(month==1 || month==3 || month==5||month==7||month==8||month==10||month==12)
          {
          z= 31-h;
          System.out.println("total number of working days were :31");
          System.out.println("employee working days are:" +z);
         
          }
          else if(month==2) {
          z=28-h;
          System.out.println("total number of working days were :28");
          System.out.println("employee working days are:" +z);
          }
          else if(month==4 || month==6 || month==9||month==11){
          z=30-h;
          System.out.println("total number of working days were :30");
          System.out.println("employee working days are:" +z);
          }
             
              System.out.println("Employee id="+employeeid);
              System.out.println("Employee name = "+name);
              System.out.println("BASIC SALARY = "+basic);
              basic1= basic/30*z;
              hra = basic1 * 0.18;
              System.out.println("HRA = "+hra);
              con= basic1 * 0.10;
              System.out.println(" DA = "+con);
              med = basic*0.15;
              System.out.println(" TA = "+med);
              lta= basic * 0.0175;
              System.out.println(" ESIC = "+lta);
              pf = basic * 0.125;
              System.out.println(" PF = "+pf);
              tot= basic1+hra+con+med+lta-pf-lic;
              System.out.println("TOTAL SALARY = "+tot);
              break;
             
              case 2:
              System.out.println("------TOTAL EMPLOYEE WISE STATEMENT-----");
              System.out.println("Total employee in company = 1");
              hra = basic * 0.18;
             
              con= basic * 0.10;
             
              med = basic*0.15;
             
              lta= basic * 0.0175;
             
              pf = basic * 0.125;
             
              tot= basic+hra+con+med+lta;
              sal = tot*12;
              System.out.println(" salary of employee : "+sal);
              break;
             
              default :
              System.out.println("wrong choice");
             
             
              }
              break;
             
              default :
              System.out.println("wrong choice");
             
             
         }
         
        
        
        
        
        
    }
}


OUTPUT :

WELCOME TO PAYROLL MANAGEMENT SYSTEM
Enter the name of employee
alex
Enter the address of the employee
adsdad
enter the employee id
2563
enter the basic salary of the employee
50000
enter the working days of employee in form of month number from 1 to 12
3
Enter the value LIC taken by employee:
533
---------------------- REPORT-----------------
1. ATTENDANCE CHART
2. EMPLOYEE DETAILS
3. TOTAL ALLOWANCES
4. TOTAL DEDUCTION
5. MONTHLY SALARY STATEMENT
ENTER YOUR CHOICE
5
----------MONTHLY SALARY STATEMENT---------
1. EMPLOYEE WISE
2. TOTAL EMPLOYEE STATEMENT
Enter your choice:
1
//////-- EMPLOYEE WISE--//////
 PAYSLIP 
enter the number of holidays taken by the employee
6
total number of working days were :31
employee working days are:25
Employee id=2563
Employee name = alex
BASIC SALARY = 50000
HRA = 7497.0
 DA = 4165.0
 TA = 7500.0
 ESIC = 875.0000000000001
 PF = 6250.0
TOTAL SALARY = 54904.0

No comments:

Post a Comment