Search This Blog

If you have any problem or question please write in the comments. We will try to solve and send you the solution. Not just that we will also post your problems solution on our blog.

Wednesday, 20 April 2011

Java program which calculates total pay of an employee including convaince allounce,house rent and bonus

import java.util.*;
class salary
{
public static void main (String arg[])
{
Scanner in=new Scanner (System.in);
int a,ca;
System.out.print ("\n\t Enter basic pay of the Employe = ");
a=in.nextInt();
ca=(a/100)*3;
float t,b=25,hr=(a*25)/1000;
t=a+ca+hr;
System.out.println ("\n\t Convaince allounce = "+ca);
System.out.println ("\n\t House rent = "+hr);
System.out.println ("\n\t Total pay = "+t);
if (t<=4500)
{
t+=1000;
System.out.println ("\n\t Total pay + bonus = "+t);
}
else if (t>4500 && t<=8000)
{
t+=2000;
System.out.println ("\n\t Total pay + bonus = "+t);
}
else
System.out.println ("\n\t Not defined");
}
}

1 comment: