-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathGrade.java
More file actions
43 lines (36 loc) · 1.06 KB
/
Grade.java
File metadata and controls
43 lines (36 loc) · 1.06 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
import java.util.*;
public class Grade {
public static void main(String[] args) {
Scanner sc = new Scanner(System.in);
//Taking inpUt
System.out.println("Enter marks percentage: ");
int n = sc.nextInt();
if (n > 100) {
System.out.println("Wrong marks entered!");
}
else if (n > 90) {
System.out.println("You got an S");
}
else if (n > 80) {
System.out.println("You got an A");
}
else if (n > 70) {
System.out.println("You got an B");
}
else if (n > 60) {
System.out.println("You got an C");
}
else if (n > 50) {
System.out.println("You got an D");
}
else if (n > 40) {
System.out.println("You got an E");
}
else if (n>0) {
System.out.println("You have failed!");
}
else {
System.out.println("Wrong marks entered!");
}
}
}