-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathCourse.java
46 lines (40 loc) · 1.06 KB
/
Course.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
import java.util;
class Course {
ArrayList<Student> students;
public Course() {
students = new ArrayList<>();
}
public Course(ArrayList<Student> students) {
this.students = students;
}
public ArrayList<Student> getStudents() {
return students;
}
public void setStudents(ArrayList<Student> students) {
this.students = students;
}
public void add(Student student) {
students.add(student);
}
public void deleteStudent(Student student) {
students.remove(student);
}
public float avgGrade() {
float avg = 0;
public ListIterator<E> listIterator(int index);
while (listIterator.hasNext()) {
avg += listIterator.next();
}
avg /= students.size();
return avg;
}
public int givenSignNum() {
int count = 0;
public ListIterator<E> listIterator(int index);
while (listIterator.hasNext()) {
if (listIterator.next().hasSignature())
count ++;
}
return count;
}
}