Employee Details and Salary

14 comments - Post a comment

/* Simple Java Program For Displaying Emplayee Details : NAme, Id No. Designation, and depending on designation deciding the salary Of the Employee*/

class emp
{
public static int emp_no;
public static String name;
public static String designation;
public void showdata()
{
System.out.println("Employee number:--->"+emp_no);
System.out.println("Employee name:------>"+name);
System.out.println("Employee designation:--->"+designation);
}
}

class salary extends emp
{
public static float bsal,hr,da,tsal;
public void cal()
{
tsal=bsal+hr+da;
System.out.println("Total salary:---->"+tsal);
}
}

class empsal extends salary
{
public void calc()
{
if (bsal >=15000)
{
hr=0.3f*bsal;
da=0.2f*bsal;
}
else if (bsal >=10000)
{
hr=0.4f*bsal;
da=0.3f*bsal;
}
else
hr=0.3f*bsal+500;
da=0.2f*bsal+500;
}
public static void main(String args[])
{
empsal E=new empsal();
emp_no=Integer.parseInt(args[0]);
name=args[1];
designation=args[2];
bsal=Integer.parseInt(args[3]);
E.showdata();
System.out.println("Employee Salary");
E.calc();
E.cal();
}
}

 
This Post has 14 Comments Add your own!
Unknown - January 12, 2008 at 8:21 PM

Thanx a lot for this program.....
it got me 100 marks!!!!!!!!

Anonymous - October 3, 2010 at 6:59 PM

hi

Unknown - December 2, 2010 at 9:19 PM

good program.....thanks a lot for who has to create this program....

Kavinraj - December 2, 2010 at 9:20 PM

thanks

Anonymous - August 3, 2011 at 3:23 PM

thank you............
it's help me to escape from my sir BEAT........

Anonymous - August 3, 2011 at 3:25 PM

thank you............
it's help me to escape from my sir BEAT........

Anonymous - August 3, 2011 at 3:25 PM

thank you............
it's help me to escape from my sir BEAT........

Anonymous - August 3, 2011 at 3:25 PM

thank you............
it's help me to escape from my sir BEAT........

Anonymous - February 17, 2012 at 7:39 AM

putang ina hindi yan ang gusto ko...

Anonymous - April 19, 2012 at 6:32 PM

a School has decided to introduce a new salary scheme for its faculty. in the new Policy, bonus is based on the fact that one is a Senior staff or Junior staff. we are to develop a software to meet the policy's requirement as broken down below:
a) Create a class called Salary
b)Create method that will calculate; the Tax which is 5% of the Gross salary
c) Bonus depending on the Status of employee, being it Senior/Junior staff
i) Senior staff 1hour is 50Gh cedis
ii) Junior staff 1hour is 20Gh cedis
iii) Net Salary = Bonus + Gross salary - Tax
d) Create another class called SalDemo with the main function
e) Declare an instance of the salary class called cal.
f) Use the cal object to check the net salary
g) Use scanner class to allow a user to enter the Status, Time and the Gross salary.

manikandan - May 4, 2012 at 10:25 PM

Create a program (using AWT) to implement the following requirement,

a. Export the data from the database table EMPLOYEE

b. Query the employee records from the database table

c. Create a file ‘data_export_MMDDYYYY.txt’


d. Export the data to this file in the format mentioned below.

manikandan - May 4, 2012 at 10:25 PM

Create a program (using AWT) to implement the following requirement,

a. Export the data from the database table EMPLOYEE

b. Query the employee records from the database table

c. Create a file ‘data_export_MMDDYYYY.txt’

d. Export the data to this file in the format mentioned below.

gowtham - July 18, 2012 at 11:58 PM

it throws me a arrayoutofbound exception , i couldn't find how to come out of it, any suggestion?

gowtham - July 19, 2012 at 12:01 AM

gime a code where the employee name should be displayed in ascending order , get the employee age instead of salary and find the second smallest age without using nested loops and sorting technique

Post a Comment