-
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathgrade.java
More file actions
30 lines (28 loc) · 790 Bytes
/
grade.java
File metadata and controls
30 lines (28 loc) · 790 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
package Methods;
import java.util.Scanner;
public class grade {
static void main() {
System.out.print("Enter your marks : ");
Scanner input = new Scanner(System.in);
int y = input.nextInt();
System.out.println(marks(y));
}
static String marks(int x){
if(x>91)
return "Grade : AA";
else if (x<90 && x>81)
return "Grade : AB";
else if (x<80 && x>71)
return "Grade : BB";
else if (x<70 && x>61)
return "Grade : BC";
else if (x<60 && x>51)
return "Grade : CD";
else if (x<50 && x>41)
return "Grade : DD";
else if (x>0 && x<=40)
return "Fail";
else
return "Enter a valid marks.";
}
}