-
Notifications
You must be signed in to change notification settings - Fork 0
/
LabEV.java
53 lines (44 loc) · 1.76 KB
/
LabEV.java
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
import java.util.*;
public class LabEV {
public static void main(String[] args) {
Scanner scanner = new Scanner(System.in);
System.out.print("Enter Your Name: ");
String name = scanner.nextLine();
System.out.print("Enter Your ID: ");
String id = scanner.nextLine();
System.out.print("Enter Your Department: ");
String department = scanner.nextLine();
System.out.print("Enter Your Number: ");
int Number = scanner.nextInt();
if (Number < 0 || Number > 100)
System.out.println("Invalid input!");
else if (Number >= 90)
{
System.out.println("Name: " + name);
System.out.println("ID: " + id);
System.out.println("Department: " + department);
System.out.println("Grade: A");
} else if (Number >= 80) {
System.out.println("Name: " + name);
System.out.println("ID: " + id);
System.out.println("Department: " + department);
System.out.println("Grade: B");
} else if (Number >= 70) {
System.out.println("Name: " + name);
System.out.println("ID: " + id);
System.out.println("Department: " + department);
System.out.println("Grade: C");
} else if (Number >= 60) {
System.out.println("Name: " + name);
System.out.println("ID: " + id);
System.out.println("Department: " + department);
System.out.println("Grade: D");
} else {
System.out.println("Name: " + name);
System.out.println("ID: " + id);
System.out.println("Department: " + department);
System.out.println("Grade: F");
}
scanner.close();
}
}