-
Notifications
You must be signed in to change notification settings - Fork 52
Expand file tree
/
Copy pathStudent.java
More file actions
60 lines (35 loc) · 1.04 KB
/
Student.java
File metadata and controls
60 lines (35 loc) · 1.04 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
52
53
54
55
56
57
58
59
60
import java.util.Scanner;
class Students{
public static void main(String args []){
Scanner input = new Scanner(System.in);
System.out.print("Enter PF subject marks : " );
int sub1 = input.nextInt();
System.out.print("Enter IICT subject marks : " );
int sub2 = input.nextInt();
System.out.print("Enter Ac subject marks : " );
int sub3 = input.nextInt();
System.out.print("Enter AP subject marks : " );
int sub4 = input.nextInt();
System.out.print("Enter FE subject marks : " );
int sub5 = input.nextInt();
float sum;
sum=sub1+sub2+sub3+sub4+sub5;
float percentage = (sum/450)*100;
System.out.print("Percentage of a Student is : " + percentage+"%" );
if(percentage==90 || percentage >=90){
System.out.print("Grade is A+");
}
else if(percentage==80 || percentage >=80){
System.out.print("Grade is B+");
}
else if(percentage==70 || percentage>=70){
System.out.print("Grade is B");
}
else if(percentage==60 || percentage >=60 ){
System.out.print("Grade is B");
}
else if(percentage<50 ){
System.out.print("Student is fail Sorry ");
}
}
}