-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathModule.java
More file actions
77 lines (63 loc) · 1.83 KB
/
Module.java
File metadata and controls
77 lines (63 loc) · 1.83 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
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
import java.util.Iterator;
import java.util.LinkedList;
/*
* @author Andrew Keyes
* Keyesandrew@live.com
*/
public class Module {
private LinkedList<Course> ModPrereqs;
private int numCredits;
private float gradeRequirement;
private float mingradeRequirement;
private String name;
private LinkedList<ConditionalCourse> ModConditionalCoursesPreReq;
public Module(String nameOfMod){
name=nameOfMod;
ModPrereqs = new LinkedList<Course>();
ModConditionalCoursesPreReq = new LinkedList<ConditionalCourse>();
}
//Add a conditional course to the list of conditional courses
public void addConditionalPreReq(ConditionalCourse addCourse){
ModConditionalCoursesPreReq.add(addCourse);
}
//Return a list of conditional courses
public Iterator<ConditionalCourse> getConditionalPreReq(){
return ModConditionalCoursesPreReq.iterator();
}
//Add a course to the list of courses
public void setPrereq(Course preCourse){
ModPrereqs.add(preCourse);
}
//Return a list of courses
public Iterator<Course> getPrereqs(){
return ModPrereqs.iterator();
}
//Set the number of credits in this module
public void setNumCredits(int num){
numCredits=num;
}
//Return the number of credits in the module
public int getNumCredits(){
return numCredits;
}
//Set the average grade required to register in this module
public void setGradeRequirement(float grade){
gradeRequirement=grade;
}
//Set the minimum grade in any course
public void setminGradeRequirement(float grade){
mingradeRequirement=grade;
}
//Return the grade required to register in this module
public float getGradeRequirement(){
return gradeRequirement;
}
//Return the minimum grade in any course
public float getminGradeRequirement(){
return mingradeRequirement;
}
//Return the name of the course
public String getName(){
return name;
}
}