Skip to content

Commit 321b240

Browse files
author
AmiyahJo
committed
fix: spotless apply
1 parent 2b58599 commit 321b240

File tree

3 files changed

+193
-196
lines changed

3 files changed

+193
-196
lines changed
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
package com.codedifferently.lesson16.amiyahjones;
22

33
public class ClassroomFullException extends Exception {
4-
public ClassroomFullException(String message) {
5-
super(message);
6-
}
4+
public ClassroomFullException(String message) {
5+
super(message);
6+
}
77
}

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

Lines changed: 82 additions & 80 deletions
Original file line numberDiff line numberDiff line change
@@ -4,104 +4,106 @@
44
import java.util.List;
55

66
public class JobReadinessProgram {
7-
private final boolean isSuccessful;
8-
ArrayList<String> students;
9-
private final Level readinessLevel;
10-
private final int lecturePerWeek;
11-
private static final ArrayList<String> teacherAssistants = new ArrayList<>();
12-
private String assignedTA;
13-
private final String mentor;
14-
private final String socialSupport;
15-
private final int MAX_CAPACITY = 22;
16-
17-
static {
18-
teacherAssistants.add("Rich");
19-
teacherAssistants.add("Vicente");
20-
teacherAssistants.add("Jordan");
21-
}
7+
private final boolean isSuccessful;
8+
ArrayList<String> students;
9+
private final Level readinessLevel;
10+
private final int lecturePerWeek;
11+
private static final ArrayList<String> teacherAssistants = new ArrayList<>();
12+
private String assignedTA;
13+
private final String mentor;
14+
private final String socialSupport;
15+
private final int MAX_CAPACITY = 22;
2216

23-
enum Level {
24-
Beginner ,
25-
Intermediate ,
26-
Advanced
27-
}
17+
static {
18+
teacherAssistants.add("Rich");
19+
teacherAssistants.add("Vicente");
20+
teacherAssistants.add("Jordan");
21+
}
2822

29-
public JobReadinessProgram(Level readinessLevel, boolean isSuccessful, String assignedTA){
30-
students = new ArrayList<>();
31-
this.readinessLevel = readinessLevel;
32-
this.isSuccessful = isSuccessful;
33-
lecturePerWeek = 3;
34-
mentor = "Anthony";
35-
socialSupport = "Estelle";
36-
if (teacherAssistants.contains(assignedTA)) {
37-
this.assignedTA = assignedTA;
38-
}
23+
enum Level {
24+
Beginner,
25+
Intermediate,
26+
Advanced
27+
}
28+
29+
public JobReadinessProgram(Level readinessLevel, boolean isSuccessful, String assignedTA) {
30+
students = new ArrayList<>();
31+
this.readinessLevel = readinessLevel;
32+
this.isSuccessful = isSuccessful;
33+
lecturePerWeek = 3;
34+
mentor = "Anthony";
35+
socialSupport = "Estelle";
36+
if (teacherAssistants.contains(assignedTA)) {
37+
this.assignedTA = assignedTA;
3938
}
40-
41-
public void addStudent(String studentName) throws ClassroomFullException{
39+
}
40+
41+
public void addStudent(String studentName) throws ClassroomFullException {
4242
int classroomCheck = students.size();
4343
if (classroomCheck == MAX_CAPACITY) {
44-
throw new ClassroomFullException("Classroom is full");
45-
} students.add(studentName);
46-
}
47-
48-
public int getStudentCount() {
49-
int count = students.size();
50-
System.out.println("Total students enrolled: " + count);
51-
return count;
44+
throw new ClassroomFullException("Classroom is full");
5245
}
46+
students.add(studentName);
47+
}
5348

54-
public void displayStudents() {
49+
public int getStudentCount() {
50+
int count = students.size();
51+
System.out.println("Total students enrolled: " + count);
52+
return count;
53+
}
54+
55+
public void displayStudents() {
5556
for (String student : students) {
56-
System.out.println(student);
57-
}
58-
}
59-
60-
public String checkReadiness() {
61-
return (readinessLevel == Level.Beginner) ? "Needs more training." : "Ready for job applications!";
57+
System.out.println(student);
6258
}
59+
}
6360

64-
public int lecturePerWeek() {
65-
System.out.println("Number of lectures students have: ");
66-
return lecturePerWeek;
67-
}
61+
public String checkReadiness() {
62+
return (readinessLevel == Level.Beginner)
63+
? "Needs more training."
64+
: "Ready for job applications!";
65+
}
6866

69-
public String getMentor() {
70-
return mentor;
71-
}
67+
public int lecturePerWeek() {
68+
System.out.println("Number of lectures students have: ");
69+
return lecturePerWeek;
70+
}
7271

73-
public String getSocialSupport() {
74-
return socialSupport;
75-
}
72+
public String getMentor() {
73+
return mentor;
74+
}
75+
76+
public String getSocialSupport() {
77+
return socialSupport;
78+
}
7679

77-
public List<String> getTeacherAssistants() {
80+
public List<String> getTeacherAssistants() {
7881
return new ArrayList<>(teacherAssistants);
79-
}
80-
81-
public boolean assignTA(String taName) {
82-
if (teacherAssistants.contains(taName)) {
83-
this.assignedTA = taName;
84-
return true;
85-
} else {
86-
throw new IllegalArgumentException("Not a TA. Please choose from: " + getTeacherAssistants());
87-
}
82+
}
83+
84+
public boolean assignTA(String taName) {
85+
if (teacherAssistants.contains(taName)) {
86+
this.assignedTA = taName;
87+
return true;
88+
} else {
89+
throw new IllegalArgumentException("Not a TA. Please choose from: " + getTeacherAssistants());
8890
}
91+
}
8992

90-
public void displayAssignedTA() {
91-
if (assignedTA != null) {
92-
System.out.println("Assigned Teacher Assistant: " + assignedTA);
93-
} else {
94-
System.out.println("No Teacher Assistant assigned.");
95-
}
93+
public void displayAssignedTA() {
94+
if (assignedTA != null) {
95+
System.out.println("Assigned Teacher Assistant: " + assignedTA);
96+
} else {
97+
System.out.println("No Teacher Assistant assigned.");
9698
}
99+
}
97100

98-
public Boolean verifyIsSuccessful() {
99-
if (isSuccessful){
100-
System.out.println("Congraulations! You made it through your journey!");
101+
public Boolean verifyIsSuccessful() {
102+
if (isSuccessful) {
103+
System.out.println("Congraulations! You made it through your journey!");
101104
} else {
102-
System.out.println("At least you got to know what software engineering is like!");
105+
System.out.println("At least you got to know what software engineering is like!");
103106
}
104107
return isSuccessful;
105-
}
106-
107-
}
108+
}
109+
}

0 commit comments

Comments
 (0)