Write a java program to calculate gross salary & net salary taking the following data

/*Write a java program to calculate gross salary & net salary taking the following data.
Input:empno,empname,basic
 Process:
 DA=50%of basic, HRA=25%of basic, CCA=Rs240/-, PF=10%of basic, PT=Rs100/-*/



import java.util.*;

class Em
     {
        public static void main(String   []args)
       {
         float DA,HRA,PF,gr_sal,net_sal;
        float CCA=240f,PT=100f;
       
     
         Scanner  a= new Scanner(System.in);
         System.out.println("enter employee rollno=");
         int r=a.nextInt();
        System.out.println("enter your basic ");
        float f=a.nextFloat();
       System.out.println("enter employee name="); 
       String w=a.nextLine();

        DA=(0.5f)*f;
HRA=(0.25f)*f;
PF=(0.1f)*f;

gr_sal=(f + DA + HRA);
net_sal=(gr_sal - CCA - PT - PF);


System.out.println("your Gross Salary : " + gr_sal);
System.out.println("your Net Salary : " + net_sal);
}
}

Comments

Popular posts from this blog

WAP a program that illustrates interface inheritance. Create two interface p1 and p2 . create Interface p which extends p1 and p2 and then create interface p12 which extends p12. Each interface declare one constants and one method. Create class Q which implements p12 and define all the methods of interface which displays value of constants

WAP that create interface on that you declare one method interest(p,r,n) then create two class simple and compound that implements interest and find simple and compound interest.