-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathDay-03-Java-Q20
More file actions
59 lines (45 loc) · 1.47 KB
/
Day-03-Java-Q20
File metadata and controls
59 lines (45 loc) · 1.47 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
/*College Management wants to separate the eligible students for their placement.so find the eligible students for the placement.
Notes:-
- If the students has 1 arrear and the cpga is above 70 - They are eligible for Placement.
- If the students has 1 or 2 arrear and the cpga is above 75 -They are eligible for Placement.
- Remaining students aren't eligible for Placement.
Input Format
input consists of one String and two integer.
Constraints
No Constraints
Output Format
print the statement "Eligible for Placement" or "Not Eligible for Placement".
Sample Input 0
John
1
76
Sample Output 0
Name of the Student:John
John is Eligible for Placement
Sample Input 1
John
2
70
Sample Output 1
Name of the Student:John
John is Not Eligible for Placement*/
#Answer
import java.io.*;
import java.util.*;
public class Solution {
public static void main(String[] args) {
Scanner sc = new Scanner(System.in);
String name = sc.nextLine();
int arrears = sc.nextInt();
int cgpa = sc.nextInt();
System.out.println("Name of the Student:" + name);
if ((arrears == 1 && cgpa > 70) ||
((arrears == 1 || arrears == 2) && cgpa > 75)) {
System.out.println(name + " is Eligible for Placement");
}
else {
System.out.println(name + " is Not Eligible for Placement");
}
/* Enter your code here. Read input from STDIN. Print output to STDOUT. Your class should be named Solution. */
}
}