Home » » Write a Program to input details for 100 employees using Array such as Employee No, Name, Address, Basic Salary, Overtime worked & Overtime payment for an hour and calculate of the followings using given conditions.

Write a Program to input details for 100 employees using Array such as Employee No, Name, Address, Basic Salary, Overtime worked & Overtime payment for an hour and calculate of the followings using given conditions.

Written By Basith on Thursday, May 22, 2014 | 12:46 AM



Overtime payments
If Basic Salary more than 30,000/-, Overtime payment = 1.2 x Overtime x Overtime payment per an hour otherwise Overtime payment = Overtime x Overtime payment per an hour
EPF
If Basic Salary more than 30,000/-, EPF = Basic Salary x 12% otherwise EPF = Basic Salary x 10%

ETF
 ETF = Basic Salary x 8%

Net Salary

Net Salary = (Basic Salary + Overtime Payment) – (EPF + ETF)



import java.io.*;
public class emp
{
public static void main (String[]args)throws IOException
{
BufferedReader stdin=new BufferedReader (new InputStreamReader(System.in));

int empNo,  otTH;
double bsal, otPayH, EPF, ETF, OvertimePayment, netsal;

String empName, address, job, dep;

System.out.flush();

System.out.println("Enter your Employee number: ");
empNo=Integer.parseInt(stdin.readLine());

System.out.println("Enter your Employee name: ");
empName=stdin.readLine();

System.out.println("Enter your Address: ");
address=stdin.readLine();

System.out.println("Enter your Job: ");
job=stdin.readLine();

System.out.println("Enter your Deppartment: ");
dep=stdin.readLine();

System.out.println("Enter your Bacis salary: ");
bsal=Integer.parseInt(stdin.readLine());

System.out.println("Enter your ovetime hours: ");
otTH=Integer.parseInt(stdin.readLine());

System.out.println("Enter your ovetime hour payment: ");
otPayH=Integer.parseInt(stdin.readLine());

if(bsal>=30000)
{
OvertimePayment=1.2*otTH*otPayH;
}
else
{
OvertimePayment=otTH*otPayH;
}

if(bsal>=30000)
{
EPF=bsal*0.12;
}
else
{
EPF=bsal*0.1;
}

ETF=(bsal*8/100);
netsal=(bsal+OvertimePayment)-(EPF+ETF);




System.out.println(netsal=(bsal+OvertimePayment)-(EPF+ETF));

System.out.println("The Employee number is : "+empNo);

System.out.println("The Employee name is : "+empName);

System.out.println("The Employee address is : "+address);

System.out.println("The Employee deppartment is : "+dep);

System.out.println("The Employee job is : "+job);

System.out.println("The Employee's bacic salary is : "+bsal);

System.out.println("The Employee's overtime payment is : "+OvertimePayment);

System.out.println("The Employee's EPF is : "+EPF);

System.out.println("The Employee's ETF is : "+ETF);

System.out.println("The Employee's Net salary is : "+netsal);
}
}
             

0 comments:

Post a Comment

Followers