Browse Source

Merge remote-tracking branch 'origin/fdai7600'

remotes/origin/fdai7887
fdai7600 11 months ago
parent
commit
3713e18f23
  1. 20
      src/main/java/org/example/Administration.java
  2. 17
      src/main/java/org/example/Main.java

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

@ -597,6 +597,26 @@ public class Administration {
} }
} }
public void createCourseWithInput(Scanner scanner) {
System.out.print("Enter Course Name: ");
String courseName = scanner.next();
System.out.print("Enter Course ID: ");
String courseID = scanner.next();
System.out.print("Enter Credits: ");
int credits = scanner.nextInt();
Course newCourse = new Course(courseName, courseID, credits);
addCourse(newCourse);
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);
}
} }

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

@ -50,27 +50,14 @@ 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
System.out.println("Enter Course Name:");
String courseName = scanner.next();
System.out.println("Enter Course ID:");
String courseID = scanner.next();
System.out.println("Enter Credits:");
int credits = scanner.nextInt();
administration.createCourse(courseName, courseID, credits);
administration.createCourseWithInput(scanner);
break; break;
case 7: case 7:
// Delete Course // Delete Course

Loading…
Cancel
Save