-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathgradesMarks.java
More file actions
34 lines (34 loc) · 811 Bytes
/
gradesMarks.java
File metadata and controls
34 lines (34 loc) · 811 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
import java.util.*;
public class gradesMarks
{
public static void main(String args[])
{
int m1,m2,m3;
Scanner sc=new Scanner(System.in);
System.out.println("Enter marks of 3 Subjects");
m1=sc.nextInt();
m2=sc.nextInt();
m3=sc.nextInt();
float avg=(float)(m1+m2+m3)/3;
if(avg>=70)
{
System.out.println("Grade A");
}
else if (avg>=60 && avg<70)
{
System.out.println("Grade B");
}
else if (avg>=50 && avg<60)
{
System.out.println("Grade C");
}
else if (avg>=40 && avg<50)
{
System.out.println("Grade D");
}
else
{
System.out.println("Fail");
}
}
}