Java Program For Payroll

class Payroll {

       public static void main(String[] args) {
        int empNo= 1234;          
        double basic = 15000;
        int att = 30;
        double daPercentage = 30.0/100;
        int residence_type =0;
        double cmhra,cmbasic,cmda;
        double tax,netsal,grosssal;
       
        cmbasic = basic/30*att;
        cmda = cmbasic*daPercentage;
       
              
                if(residence_type == 0)
            
            cmhra = 0;
        else if(residence_type == 1)
              cmhra =((basic)*0.1);
        else 
            cmhra = ((basic)*0.15);
       
                     
        grosssal = (cmbasic+cmhra+cmda);
        tax = ((grosssal)*0.1);
        netsal  = (grosssal - tax);
        System.out.println("The salary of the employee = " +netsal );
        
    }
}             
                
  
Bhanu Namikaze

Bhanu Namikaze is an Ethical Hacker, Security Analyst, Blogger, Web Developer and a Mechanical Engineer. He Enjoys writing articles, Blogging, Debugging Errors and Capture the Flags. Enjoy Learning; There is Nothing Like Absolute Defeat - Try and try until you Succeed.

No comments:

Post a Comment