Update src/main/java/services/SchoolSystem.java
This commit is contained in:
@@ -16,7 +16,7 @@ public class SchoolSystem {
|
||||
}
|
||||
|
||||
// ========== Student Management ==========
|
||||
//TODO
|
||||
//TODO
|
||||
|
||||
// ========== Teacher Management ==========
|
||||
public boolean registerTeacher(String username, String password) {
|
||||
@@ -44,7 +44,7 @@ public class SchoolSystem {
|
||||
|
||||
// ========== Course Management ==========
|
||||
public boolean addCourseToSystem(String courseName) {
|
||||
//TODO
|
||||
//TODO
|
||||
return true;
|
||||
}
|
||||
|
||||
@@ -60,14 +60,15 @@ public class SchoolSystem {
|
||||
return null;
|
||||
}
|
||||
|
||||
public void showAllCourses() {
|
||||
public String getAllCoursesDisplay() {
|
||||
if (allCourses.isEmpty()) {
|
||||
System.out.println(" No courses available yet.");
|
||||
return " No courses available yet.";
|
||||
} else {
|
||||
System.out.println("\n All Available Courses:");
|
||||
StringBuilder sb = new StringBuilder("\n All Available Courses:\n");
|
||||
for (int i = 0; i < allCourses.size(); i++) {
|
||||
System.out.println(" " + (i+1) + ". " + allCourses.get(i));
|
||||
sb.append(" ").append(i+1).append(". ").append(allCourses.get(i)).append("\n");
|
||||
}
|
||||
return sb.toString();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user