forked from pikachu-17/java-projects
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathemployee
More file actions
41 lines (40 loc) · 850 Bytes
/
employee
File metadata and controls
41 lines (40 loc) · 850 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
public class Employee
{
String name;
int code;
double basic, hra, da, pf;
double net=0.0d;
public Employee()
{
basic=0.0d;
hra=0.0d;
da=0.0d;
pf=0;
}
public Employee(int id, String namee, double b)
{
code=id;
basic=b;
name=namee;
}
public void calculate()
{
hra=0.10*basic;
da=0.55*basic;
net=(basic+da+hra)-pf;
}
public void display()
{
System.out.println("Employee id\t"+code);
System.out.println("Employee name\t"+name);
System.out.println("HRA\t"+hra);
System.out.println("da\t"+da);
System.out.println("net\t"+net);
}
public static void main()
{
Employee obj=new Employee(1,"ABCD",100000.0);
obj.calculate();
obj.display();
}
}