-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathGrade.java
More file actions
30 lines (25 loc) · 877 Bytes
/
Grade.java
File metadata and controls
30 lines (25 loc) · 877 Bytes
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
//write a program to print grade of a person. 90= is AA. 80+ is AB. 70+ is BB and so on. 40- is FF
import java.util.Scanner;
class Grade{
public static void main(String [] args){
Scanner sc = new Scanner(System.in);
int n = sc.nextInt();
if(n >= 90 && n < 100){
System.out.println("AA");
}else if(n < 90 && n >= 80){
System.out.println("AB");
}else if(n < 80 && n >= 70){
System.out.println("BB");
}else if(n < 70 && n >= 60){
System.out.println("CC");
}else if(n < 60 && n >=50){
System.out.println("DD");
}else if(n < 50 && n >= 40){
System.out.println("EE");
}else if(n < 40) {
System.out.println("bro you have failed");
}else{
System.out.println("invalid");
}
}
}