-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathYT05.java
More file actions
60 lines (47 loc) · 1.28 KB
/
YT05.java
File metadata and controls
60 lines (47 loc) · 1.28 KB
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
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
import java.io.*;
public class YT05
{
String name;
int empno, basic;
double da, hra, pf, gross, net;
public YT05(int b)
{
basic=b;
}
public void getdata(String n, int e)
{
name=n;
empno=e;
}
public void compute()
{
da=0.3*basic;
hra=0.15*basic;
pf=0.12*basic;
gross=da+hra+pf;
net=gross-pf;
}
public void display()
{
System.out.println();
System.out.println("Name"+"\t"+"Emp No"+"\t"+"Gross"+"\t"+"Net");
System.out.print(name+"\t"+empno+"\t"+gross+"\t"+net);
}
public static void main(String[] args)throws IOException
{
int b1, e1;
String n1;
InputStreamReader I = new InputStreamReader(System.in);
BufferedReader br = new BufferedReader(I);
System.out.println("Enter the basic:");
b1=Integer.parseInt(br.readLine());
System.out.println("Enter the employee no:");
e1=Integer.parseInt(br.readLine());
System.out.println("Enter the name of employee:");
n1=br.readLine();
YT05 E1 = new YT05(b1);
E1.getdata(n1, e1);
E1.compute();
E1.display();
}
}