-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathEmployeeData.java
More file actions
50 lines (49 loc) · 1 KB
/
EmployeeData.java
File metadata and controls
50 lines (49 loc) · 1 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
import java.util.*;
import java.io.*;
class Emp
{
int id;
char Name;
int NOH;
double salary;
}
class Main
{
void getData()
{
System.out.println("Enter the details of Empolyee "+(i+1)+" in the format Empolyee ID, Name, Number of hours");
int e[i].id = sc.nextInt();
char e[i].Name = sc.nextLine();
int e[i].NOH = sc.nextInt();
double e[i].salary = e[i].NOH*100;
}
void Display()
{
System.out.println("Id \t Name \t Number of hours \t Wages");
for(i=0;i<5;i++)
{
System.out.println("e[i].id+"\t"+e[i].Name+"\t"+e[i].NOH+"\t"+e[i].salary");
}
}
void Calculate()
{
int high=0;
high=e[0].salary;
if(e[i].salary>high)
high=e[i].salary;
System.out.println("The Empolyee with highest wages is Employee id "+e[i].id+" with the wage of "+e[i].salary);
}
public static void main(String a[])
{
int i;
Scanner sc = new Scanner(System.in);
Emp[] e = new Emp[10];
for(i=0;i<5;i++)
{
e[i] = new Student();
e[i].getData();
e[i].Display();
e[i].calculate();
}
}
}