//Employee no and salary calculations
import java.util.Scanner;
class Employee {
public static void main(String args[])
{
Scanner sc=new Scanner(System.in);
System.out.println("Enter employee no and basic salary:");
int eid=sc.nextInt();
float bs=sc.nextFloat();
float hra,da,ta,gs;
if(bs>5000)
{
hra=0.05f*bs;
da=0.08f*bs;
ta=500;
}
else if(bs>2000)
{
hra=0.04f*bs;
da=0.06f*bs;
ta=300;
}
else
hra=da=ta=0;
gs=bs+hra+da+ta;
System.out.println("Employee no:"+eid+" Gross Salary:"+gs);
}
}
import java.util.Scanner;
class Employee {
public static void main(String args[])
{
Scanner sc=new Scanner(System.in);
System.out.println("Enter employee no and basic salary:");
int eid=sc.nextInt();
float bs=sc.nextFloat();
float hra,da,ta,gs;
if(bs>5000)
{
hra=0.05f*bs;
da=0.08f*bs;
ta=500;
}
else if(bs>2000)
{
hra=0.04f*bs;
da=0.06f*bs;
ta=300;
}
else
hra=da=ta=0;
gs=bs+hra+da+ta;
System.out.println("Employee no:"+eid+" Gross Salary:"+gs);
}
}
No comments:
Post a Comment