-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathStudentGradeCalculator.java
More file actions
51 lines (50 loc) · 1.93 KB
/
StudentGradeCalculator.java
File metadata and controls
51 lines (50 loc) · 1.93 KB
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
45
46
47
48
49
50
51
import java.util.Scanner;
public class StudentGradeCalculator {
public static void main(String args[]) {
Scanner sc = new Scanner(System.in);
System.out.println("***************Student Grade Calculator***************\n");
System.out.println("Enter the name of the Student");
String name =sc.nextLine();
System.out.println("Enter division");
String division =sc.nextLine();
System.out.println("Marks Obtained out of 100 in Maths");
int maths = sc.nextInt();
System.out.println("Marks Obtained out od 100 in Science");
int science = sc.nextInt();
System.out.println("Marks Obtained out of 100 in English");
int english = sc.nextInt();
System.out.println("Marks Obtained out of 100 in History");
int history = sc.nextInt();
System.out.println("Marks Obtained out of 100in Geography");
int geography = sc.nextInt();
int total = maths+science+english+history+geography;
double percentage = total / 5 ;
System.out.println(name);
System.out.println("Divison is" + " " + division);
System.out.println("The total is"+ " "+total);
System.out.println("The average percentage is"+ " "+percentage);
if(total<=500 && total>=400)
{
System.out.println("The grade recieved is A");
}
else if(total<400 && total>=300)
{
System.out.println("The grade recieved is B");
}
else if(total<300 && total>=200)
{
System.out.println("The grade recieved is C");
}
else if(total<200 && total>=100)
{
System.out.println("The grade recieved is D");
}
else if(total<100 && total>=0)
{
System.out.println("The grade recieved is E");
}
else {
System.out.println("Invalid");
}
}
}