|
@ -1,4 +1,6 @@ |
|
|
package org.example; |
|
|
package org.example; |
|
|
|
|
|
import java.util.ArrayList; |
|
|
|
|
|
import java.util.List; |
|
|
import java.util.Scanner; |
|
|
import java.util.Scanner; |
|
|
|
|
|
|
|
|
public class Main { |
|
|
public class Main { |
|
@ -44,6 +46,27 @@ public class Main { |
|
|
break; |
|
|
break; |
|
|
case 3: |
|
|
case 3: |
|
|
// Enroll Prof to Course |
|
|
// Enroll Prof to Course |
|
|
|
|
|
|
|
|
|
|
|
System.out.println("Please enter Professor ID"); |
|
|
|
|
|
String profID = scanner.next(); |
|
|
|
|
|
while(administration.findProfessorById(profID) == null){ |
|
|
|
|
|
System.out.println("This Professor does not exist"); |
|
|
|
|
|
System.out.println("Please enter a new Professor ID"); |
|
|
|
|
|
profID = scanner.next(); |
|
|
|
|
|
} |
|
|
|
|
|
System.out.println("Please enter Course ID"); |
|
|
|
|
|
String courseID = scanner.next(); |
|
|
|
|
|
while(administration.findCourseByID(courseID) == null){ |
|
|
|
|
|
System.out.println("This Course does not exist"); |
|
|
|
|
|
System.out.println("Please enter a new Course ID"); |
|
|
|
|
|
courseID = scanner.next(); |
|
|
|
|
|
} |
|
|
|
|
|
Professor prof = administration.findProfessorById(profID); |
|
|
|
|
|
Course course = administration.findCourseByID(courseID); |
|
|
|
|
|
List<Course> courseList = prof.getCoursesTaught(); |
|
|
|
|
|
courseList.add(course); |
|
|
|
|
|
prof.setCoursesTaught(courseList); |
|
|
|
|
|
|
|
|
break; |
|
|
break; |
|
|
case 4: |
|
|
case 4: |
|
|
// Drop Prof from Course |
|
|
// Drop Prof from Course |
|
|