Skip to content

Commit 8ac09c4

Browse files
author
AmiyahJo
committed
feat: initialized MAX_CAPACITY , adds an if statement for conditional statement
fix: changed order of logic in addStudent()
1 parent 11b0e7e commit 8ac09c4

File tree

1 file changed

+5
-4
lines changed

1 file changed

+5
-4
lines changed

lesson_16/objects/objects_app/src/main/java/com/codedifferently/lesson16/amiyahjones/JobReadinessProgram.java

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ public class JobReadinessProgram {
1212
private String assignedTA;
1313
private final String mentor;
1414
private final String socialSupport;
15-
private final int MAX_CAPACITY;
15+
private final int MAX_CAPACITY = 22;
1616

1717
static {
1818
teacherAssistants.add("Rich");
@@ -33,15 +33,16 @@ public JobReadinessProgram(Level readinessLevel, boolean isSuccessful, String as
3333
lecturePerWeek = 3;
3434
mentor = "Anthony";
3535
socialSupport = "Estelle";
36-
this.assignedTA = assignedTA;
36+
if (teacherAssistants.contains(assignedTA)) {
37+
this.assignedTA = assignedTA;
38+
}
3739
}
3840

3941
public void addStudent(String studentName) throws ClassroomFullException{
40-
students.add(studentName);
4142
int classroomCheck = students.size();
4243
if (classroomCheck == MAX_CAPACITY) {
4344
throw new ClassroomFullException("Classroom is full");
44-
}
45+
} students.add(studentName);
4546
}
4647

4748
public int getStudentCount() {

0 commit comments

Comments
 (0)