A robust Java-based student management system that demonstrates object-oriented programming concepts with comprehensive exception handling. This system provides CRUD operations for student records with custom exceptions for better error handling and user feedback.
- Add new students
- Display all students
- Search students by:
- PRN (Permanent Registration Number)
- Name
- Position in list
- Update student records
- Delete student records
Each functionality includes multiple custom exceptions:
DuplicatePRNException: When attempting to add a student with an existing PRNInvalidStudentDataException: For invalid student information
EmptyStudentListException: When trying to display an empty student list
StudentNotFoundException: When a student cannot be foundInvalidSearchCriteriaException: For invalid search parameters
StudentUpdateException: When update operation failsInvalidUpdateDataException: For invalid update data
StudentDeletionException: When deletion operation fails
InvalidPRNException: For invalid PRN formatInvalidMarksException: For invalid marks values
Student-Management-System/
├── src/
│ ├── Main.java # Main driver class with menu interface
│ ├── Student.java # Student entity class
│ ├── StudentOperations.java # Business logic and operations
│ └── StudentExceptions.java # Custom exceptions
└── README.md
- Java Development Kit (JDK) 23 or higher
- Any Java IDE (Eclipse, IntelliJ IDEA, etc.)
- Clone the repository:
git clone https://github.com/yourusername/student-management-system.git- Navigate to the project directory:
cd student-management-system- Compile the Java files:
javac *.java- Run the application:
java MainThe system presents a menu-driven interface with the following options:
-
Add Student
- Enter PRN (11-digit number)
- Enter Name
- Enter Date of Birth (DD-MM-YYYY)
- Enter Marks (0-100)
-
Display All Students
- Shows list of all students with their details
-
Search Student by PRN
- Enter PRN to find specific student
-
Search Student by Name
- Enter name to find student
-
Search Student by Position
- Enter position number in list
-
Update Student
- Enter PRN of student to update
- Enter new details
-
Delete Student
- Enter PRN of student to delete
-
Exit
- Terminate the program
try {
operations.addStudent(newStudent);
} catch (StudentExceptions.DuplicatePRNException e) {
System.out.println("Error: " + e.getMessage());
} catch (StudentExceptions.InvalidStudentDataException e) {
System.out.println("Error: " + e.getMessage());
}- PRN must be an 11-digit number
- Marks must be between 0 and 100
- Name and Date of Birth cannot be empty
- All fields are required when adding or updating a student
- Fork the repository
- Create your feature branch (
git checkout -b feature/AmazingFeature) - Commit your changes (
git commit -m 'Add some AmazingFeature') - Push to the branch (
git push origin feature/AmazingFeature) - Open a Pull Request
This project is licensed under the MIT License - see the LICENSE file for details.
Neil Carodz
- Thanks to all contributors who have helped with testing and improvements
- Special thanks to SIT for the project requirements and guidance