/* Simple Java Program For Deciding Employee Salary Depending On His Designation*/
class Salary2
{
public static void main(String args[])
{
float gross,bs,hre,da;
bs = Integer.parseInt(args[0]);
if(bs >15000)
{
hre = 0.3f* bs;
da = 0.2f*bs;
gross = bs + hre + da;
System.out.println("Gross Salary : "+ gross);
}
else if(bs >10000)
{
hre = 0.4f* bs;
da = 0.3f*bs;
gross = bs + hre + da;
System.out.println("Gross Salary : "+ gross);
}
else if(bs >5000)
{
hre = 0.3f* bs;
da = 0.2f*bs;
gross = bs + hre + da +500;
System.out.println("Gross Salary : "+ gross);
}
}
}
Labels: Core Java
Subscribe to:
Post Comments (Atom)
Post a Comment