-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathRating.java
More file actions
136 lines (94 loc) · 2.62 KB
/
Rating.java
File metadata and controls
136 lines (94 loc) · 2.62 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
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
package complex;
import java.util.*;
public class Rating {
private String deliverable;
private String sports;
private String outreach;
private int emp_id;
private String emp_name;
public static String rate = null;
public String getDeliverable() {
return deliverable;
}
public void setDeliverable(String deliverable) {
this.deliverable = deliverable;
}
public String getSports() {
return sports;
}
public void setSports(String sports) {
this.sports = sports;
}
public String getOutreach() {
return outreach;
}
public void setOutreach(String outreach) {
this.outreach = outreach;
}
public int getEmp_id() {
return emp_id;
}
public void setEmp_id(int emp_id) {
this.emp_id = emp_id;
}
public String getEmp_name() {
return emp_name;
}
public void setEmp_name(String emp_name) {
this.emp_name = emp_name;
}
public String rating(String deliverable, String sports, String outreach)
{
if (deliverable.equals("A") && sports.equals("A") && outreach.equals("A"))
{
rate = "A";
}
else if (deliverable.equals("A") && sports.equals("A") && outreach.equals("B"))
{
rate = "B";
}
else if (deliverable.equals("A") && sports.equals("B") && outreach.equals("A"))
{
rate = "B";
}
else if (deliverable.equals("A") && sports.equals("B") && outreach.equals("B"))
{
rate = "B";
}
else if (deliverable.equals("B") && sports.equals("B") && outreach.equals("B"))
{
rate = "B";
}
else
{
rate = "C";
}
return rate;
}
public static void main (String Args[])
{
Rating r = new Rating();
Scanner S = new Scanner(System.in);
System.out.println("Please Enter number of Employee who are going to be rated");
int count = S.nextInt();
List<String> empList = new ArrayList<String>();
for (int i=0;i<count;i++)
{
System.out.println("Please Enter the Emp ID");
r.emp_id = S.nextInt();
System.out.println("Please Enter the Emp Name");
r.emp_name = S.next();
System.out.println("Please Enter the rating for deliverable in terms of A or B or C");
r.setDeliverable(S.next());
System.out.println("Please Enter the rating for Sports in terms of A or B or C");
r.setSports(S.next());
System.out.println("Please Enter the rating for Outreach in terms of A or B or C");
r.setOutreach(S.next());
r.rating(r.deliverable, r.sports, r.outreach);
empList.add(Integer.toString((r.getEmp_id())));
empList.add(r.getEmp_name());
empList.add(rate);
}
System.out.println(empList);
}
}