-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathStudent_Gread_System.java
More file actions
44 lines (32 loc) · 927 Bytes
/
Student_Gread_System.java
File metadata and controls
44 lines (32 loc) · 927 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
31
32
33
34
35
36
37
38
39
40
41
42
43
44
package Exp2;
import java.util.InputMismatchException;
import java.util.Scanner;
public class Student_Gread_System {
public static void main(String[] args) {
Scanner sc=new Scanner(System.in);
System.out.println("Enter student marks :");
try {
double marks=sc.nextDouble();
if(marks<35) {
System.out.println("Fail");
}
else if(marks>=35&&marks<=50) {
System.out.println("marks is: "+marks+" Gread :C");
}
else if(marks>50&&marks<=70){
System.out.println("marks is: "+marks+" Gread :B");
}
else if(marks>70&&marks<=80){
System.out.println("marks is: "+marks+" Gread :A");
}
else if(marks>=90){
System.out.println("marks is: "+marks+" Gread :A");
}
else {
System.out.println("Invalid marks");
}
}catch(InputMismatchException e)
{
System.out.println("plz enter valid marks");
}
}}