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);
}
}
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
Post a Comment