Class Menu

java.lang.Object
com.project.system.Menu

public class Menu extends Object
The Menu class provides the user interface for the Student-Course Registration System. It allows performing CRUD operations on students and courses using a console-based menu.
  • Constructor Details

    • Menu

      public Menu()
      Constructs a new Menu instance and initializes the MongoDB connection. It continuously displays the menu and processes user input until the program exits.
  • Method Details

    • addStudent

      private void addStudent(Scanner scanner, StudentService studentService)
      Adds a new student by taking input from the user.
      Parameters:
      scanner - The scanner to read user input.
      studentService - The service for managing student operations.
    • editStudent

      private void editStudent(Scanner scanner, StudentService studentService)
      Edits the details of an existing student based on the user-provided ID.
      Parameters:
      scanner - The scanner to read user input.
      studentService - The service for managing student operations.
    • deleteStudent

      private void deleteStudent(Scanner scanner, StudentService studentService)
      Deletes a student by ID.
      Parameters:
      scanner - The scanner to read user input.
      studentService - The service for managing student operations.
    • searchStudent

      private void searchStudent(Scanner scanner, StudentService studentService)
      Searches for a student by ID and displays the result.
      Parameters:
      scanner - The scanner to read user input.
      studentService - The service for managing student operations.
    • addCourse

      private void addCourse(Scanner scanner, CourseService courseService)
      Adds a new course by taking input from the user.
      Parameters:
      scanner - The scanner to read user input.
      courseService - The service for managing course operations.
    • deleteCourse

      private void deleteCourse(Scanner scanner, CourseService courseService)
      Deletes a course by name.
      Parameters:
      scanner - The scanner to read user input.
      courseService - The service for managing course operations.
    • searchCourse

      private void searchCourse(Scanner scanner, CourseService courseService)
      Searches for a course by name and displays the result.
      Parameters:
      scanner - The scanner to read user input.
      courseService - The service for managing course operations.