-
Notifications
You must be signed in to change notification settings - Fork 0
/
gradeMark.java
28 lines (27 loc) · 978 Bytes
/
gradeMark.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
import java.util.Scanner;
public class gradeMark {
public static void main(String[] args) {
Scanner scan = new Scanner(System.in);
int mark;
System.out.println("Please enter your mark:");
mark = scan.nextInt();
if (mark >= 0 && mark <= 29) {
System.out.println("Grade F");
} else if (mark >= 30 && mark <= 39) {
System.out.println("Grade E");
} else if (mark >= 40 && mark <= 49) {
System.out.println("Grade D");
} else if (mark >= 50 && mark <= 59) {
System.out.println("Grade C");
} else if (mark >= 60 && mark <= 69) {
System.out.println("Grade B");
} else if (mark >=70 && mark <= 89) {
System.out.println("Grade A");
} else if (mark >=90 && mark <= 100) {
System.out.println("Grade A*");
} else {
System.out.println("Mark is invalid");
}
scan.close();
}
}