-
Notifications
You must be signed in to change notification settings - Fork 0
/
StudentGradeCalculatorApp.java
69 lines (68 loc) · 2.41 KB
/
StudentGradeCalculatorApp.java
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
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
import java.util.*;
public class StudentGradeCalculatorApp{
Scanner scanner=new Scanner(System.in);
void Developer(){
System.out.println("****************************");
System.out.println("| STUDENT GRADE CALCULATOR |");
System.out.println("|\tBY SOORAT ALI \t |");
System.out.println("****************************\n\n");
}
void Calculator(){
System.out.print("Enter Obtained Marks in English : ");
int eMarks=scanner.nextInt();
System.out.print("Enter Obtained Marks in Mathematics : ");
int mMarks=scanner.nextInt();
System.out.print("Enter Obtained Marks in Biology : ");
int bMarks=scanner.nextInt();
System.out.print("Enter Obtained Marks in Physics : ");
int pMarks=scanner.nextInt();
System.out.print("Enter Obtained Marks in Chemistry : ");
int chMarks=scanner.nextInt();
System.out.print("Enter Obtained Marks in Computer : ");
int cMarks=scanner.nextInt();
int obtainedMarks=eMarks+mMarks+bMarks+pMarks+chMarks+cMarks;
System.out.println("\n\nResult");
System.out.println("Total Obtained Marks : " +obtainedMarks);
System.out.println("Total Marks : 600");
float percentage=((float)obtainedMarks/600)*100;
System.out.println("Percentage : " +percentage +"%");
System.out.print("Status : ");
if(percentage>=50){
System.out.println("Pass");
}
else{
System.out.println("Fail");
}
System.out.print("Grade : ");
if(percentage>=90){
System.out.println("A+");
}
else if(percentage>=80){
System.out.println("A");
}
else if(percentage>=75){
System.out.println("B+");
}
else if(percentage>=69){
System.out.println("B");
}
else if(percentage>=60){
System.out.println("C+");
}
else if(percentage>=50){
System.out.println("C");
}
else if(percentage<50){
System.out.println("F");
}
}
void ControlPanel(){
Developer();
Calculator();
scanner.close();
}
public static void main(String[] args){
StudentGradeCalculatorApp sgc=new StudentGradeCalculatorApp();
sgc.ControlPanel();
}
}