-
Notifications
You must be signed in to change notification settings - Fork 0
/
GradingSystem.java
58 lines (42 loc) · 1.94 KB
/
GradingSystem.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
import java.util.*;
public class GradingSystem {
public void grades(LinkedList<StudentDetails> studentList) throws Exception {
ListIterator<StudentDetails> it1 = studentList.listIterator();
PrintingStudentDetails printingStudentDetails=new PrintingStudentDetails();
while ( it1.hasNext() ) {
StudentDetails s = (StudentDetails) it1.next();
float percentage=s.getTotalMarks()/800*100;
if(percentage>90 && percentage<=100){
System.out.println("Top Graders");
printingStudentDetails.displayDetails(studentList,s.getName());
}
}
ListIterator<StudentDetails> it2 = studentList.listIterator();
while ( it2.hasNext() ) {
StudentDetails s = (StudentDetails) it2.next();
float percentage=s.getTotalMarks()/800*100;
if (percentage>80 && percentage<=90) {
System.out.println("Good Graders");
printingStudentDetails.displayDetails(studentList,s.getName());
}
}
ListIterator<StudentDetails> it3 = studentList.listIterator();
while ( it3.hasNext() ) {
StudentDetails s = (StudentDetails) it3.next();
float percentage=s.getTotalMarks()/800*100;
if (percentage>70 && percentage<=80) {
System.out.println("Average Performers");
printingStudentDetails.displayDetails(studentList,s.getName());
}
}
ListIterator<StudentDetails> it4 = studentList.listIterator();
while ( it4.hasNext() ) {
StudentDetails s = (StudentDetails) it4.next();
float percentage=s.getTotalMarks()/800*100;
if(percentage<35){
System.out.println("Failures");
printingStudentDetails.displayDetails(studentList,s.getName());
}
}
}
}