-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathgrades.java
More file actions
38 lines (32 loc) · 1.08 KB
/
grades.java
File metadata and controls
38 lines (32 loc) · 1.08 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
import java.util.Scanner;
public class grades {
public static void main (String[] args) {
Scanner scanner = new Scanner(System.in);
System.out.println("Give points[0-100]");
int points = Integer.valueOf(scanner.nextLine());
if (points < 0) {
System.out.println("Grade: impossible!");
}
else if (points <= 49){
System.out.println("Grade: failed");
}
else if (points >=50 && points <= 59) {
System.out.println("Grade: 1");
}
else if (points >= 60 && points <= 69) {
System.out.println("Grade: 2");
}
else if (points >= 70 && points <= 79) {
System.out.println("Grade: 3");
}
else if (points >= 80 && points <= 89) {
System.out.println("Grade: 4");
}
else if (points >= 90 && points <= 100) {
System.out.println("Grade: 5");
}
else if (points > 100) {
System.out.println("Grade; incredible!");
}
}
}