|
|
@ -1,9 +1,6 @@ |
|
|
|
package org.example; |
|
|
|
|
|
|
|
import java.util.ArrayList; |
|
|
|
import java.util.Iterator; |
|
|
|
import java.util.List; |
|
|
|
import java.util.Scanner; |
|
|
|
import java.util.*; |
|
|
|
|
|
|
|
public class Administration { |
|
|
|
/** |
|
|
@ -541,6 +538,29 @@ public class Administration { |
|
|
|
return false; |
|
|
|
} |
|
|
|
|
|
|
|
public void dropStudentFromCourse(String studentID, String courseID){ |
|
|
|
Student student = this.findStudentById(studentID); |
|
|
|
Course course = this.findCourseByID(courseID); |
|
|
|
|
|
|
|
Map<Course, String> studentCourses = student.getCourseGrades(); |
|
|
|
if (student != null && course != null) { |
|
|
|
|
|
|
|
if(studentCourses.containsKey(course)){ |
|
|
|
studentCourses.remove(course); |
|
|
|
student.setCourseGrades(studentCourses); |
|
|
|
System.out.println("Student has been dropped from the choosen course"); |
|
|
|
} |
|
|
|
else{ |
|
|
|
System.out.println("Student was not in this course"); |
|
|
|
} |
|
|
|
|
|
|
|
} else { |
|
|
|
if (student == null) System.out.println("Student ID not found."); |
|
|
|
if (course == null) System.out.println("Course ID not found."); |
|
|
|
} |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|