Browse Source

refactoring: encapsulated the input handling related with case 5

remotes/origin/fdai7887
fdai7600 11 months ago
parent
commit
a3dd0f5764
  1. 8
      src/main/java/org/example/Administration.java
  2. 9
      src/main/java/org/example/Main.java

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

@ -609,6 +609,14 @@ public class Administration {
System.out.println("Course created successfully."); System.out.println("Course created successfully.");
} }
public void dropStudentFromCourseWithInput(Scanner scanner) {
System.out.println("Enter Student ID:");
String studentID = scanner.next();
System.out.println("Enter Course ID:");
String courseID = scanner.next();
dropStudentFromCourse(studentID, courseID);
}
} }

9
src/main/java/org/example/Main.java

@ -50,17 +50,10 @@ public class Main {
case 4: case 4:
// Drop Prof from Course // Drop Prof from Course
administration.dropProfFromCourse(); administration.dropProfFromCourse();
break; break;
case 5: case 5:
// Drop Student from Course // Drop Student from Course
System.out.println("Enter Student ID");
String studentID = scanner.next();
System.out.println("Enter Course ID");
String courseIdToDrop = scanner.next();
administration.dropStudentFromCourse(studentID, courseIdToDrop);
administration.dropStudentFromCourseWithInput(scanner);
break; break;
case 6: case 6:
// Create Course // Create Course

Loading…
Cancel
Save