-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathOOPS7.java
More file actions
63 lines (44 loc) · 1.38 KB
/
OOPS7.java
File metadata and controls
63 lines (44 loc) · 1.38 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
61
62
63
import java.util.Scanner;
class Employees{
String Ename, Eid;
double Basic, DA, Gross, Net_Sal ,IT;
public void read() {
Scanner sc=new Scanner(System.in);
System.out.println("Enter the name of the Employee");
Ename=sc.nextLine();
System.out.println("Enter the id Number of the Employee");
Eid=sc.nextLine();
System.out.println("Enter the basic Salary of the employee fucker");
Basic=sc.nextDouble();
}
public void compute()
{ DA=0.52*Basic;
Gross=Basic+DA;
IT=0.30*Gross;
Net_Sal=Gross-IT;
}
public void display() {
System.out.println("Ename " +Ename);
System.out .println("Eid "+Eid);
System.out .println("Basic : "+Basic);
System.out .println("DA :"+DA);
System.out .println("Gross :"+Gross);
System.out .println("IT :"+IT);
System.out .println("Net_Sal :"+Net_Sal);
}
}
public class OOPS7 {
public static void main(String[] args) {
Scanner sc=new Scanner(System.in);
System.out.println("Enter the number of employees u wanna Enter");
int n=sc.nextInt();
Employees[] Employee=new Employees[n];
for(int i=0;i<n;i++)
{ Employee[i] = new Employees();
System.out.println("Enter details for employee " + (i+1) + ":");
Employee[i].read();
Employee[i].compute();
Employee[i].display();
}
}
}