-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathCourse (1).java
88 lines (78 loc) · 2.42 KB
/
Course (1).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
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
import java.util.*;
public class Course{
private String Course_Name;
private int Units_Per_Course;
private List<Student> students = new ArrayList<Student>();
private List<Teacher> teachers = new ArrayList<Teacher>();
private String Date_Of_Exam ;
private int Number_Of_Students_Assigned;
Course(String courseName, int unitsPerCourse ) {
this.Course_Name = courseName;
this.Units_Per_Course = unitsPerCourse;
}
public String getCourseName() {
return Course_Name;
}
public String getDate_Of_Exam(){
return Date_Of_Exam;
}
public int getUnitsPerCourse() {
return Units_Per_Course;
}
public List<Student> getStudents() {
return students;
}
public boolean isAvailable() {
if(teachers.size()>0){
return true;
}
return false;
}
public int getNumberOfStudentsAssigned() {
return Number_Of_Students_Assigned;
}
public void setCourseName(String courseName) {
this.Course_Name = courseName;
}
public void setDate_Of_Exam(String Date_Of_Exam){
this.Date_Of_Exam = Date_Of_Exam ;
}
public void setUnitsPerCourse(int unitsPerCourse) {
this.Units_Per_Course = unitsPerCourse;
}
public void setStudents(List<Student> students) {
this.students = students;
}
public void setNumberOfStudentsAssigned(int numberOfStudentsAssigned) {
this.Number_Of_Students_Assigned = numberOfStudentsAssigned;
}
public void PrintStudents(){
for (Student student : students){
System.out.println(student.getName());
}
}
public void AddStudents(Student New){
students.add(New);
Number_Of_Students_Assigned ++;
}
public void RemoveStudents(Student New){
students.remove(New);
Number_Of_Students_Assigned --;
}
public int sort(List<Integer> grades){
Collections.sort(grades);
int Length = grades.size();
if (!grades.isEmpty()) {
return grades.get(Length - 1);
} else {
return 0 ;
}
}
public String[] DateCreator(String Date_Of_Exam){
String[] Result = Date_Of_Exam.split("\\/");
return Result;
}
public void addteacher(Teacher teacher ){
teachers.add(teacher);
}
}