Browse Source

Finalizing documentation in Administration class

remotes/origin/fdai7780
fdai7921 11 months ago
parent
commit
cdfe6d3ddb
  1. 17
      src/main/java/org/example/Administration.java

17
src/main/java/org/example/Administration.java

@ -26,10 +26,21 @@ public class Administration {
}
/**
* Adds a course to the list of courses.
*
* @param course The course to be added.
*/
public void addCourse(Course course){
courses.add(course);
}
/**
* Deletes a course from the list of courses based on its course ID.
*
* @param courseID The course ID of the course to be deleted.
* @return true if the course is successfully deleted, false otherwise.
*/
public boolean deleteCourse(String courseID){
for(Course course : courses){
if(course.getCourseCode().equals(courseID)){
@ -40,6 +51,12 @@ public class Administration {
return false;
}
/**
* Finds a course in the list of courses based on its course ID.
*
* @param courseID The course ID of the course to be found.
* @return The course with the specified course ID, or null if not found.
*/
public Course findCourseByID(String courseID){
for(Course course : courses){
if(course.getCourseCode().equals(courseID)){

Loading…
Cancel
Save