Student Database Management System
This Java program enables users to manage a student database efficiently. The program utilizes a class named Student
with attributes such as name, roll number, age, and marks. It implements functionalities like adding students, viewing student details, searching students by roll number, calculating average marks, and handling exceptions gracefully.
-
Add Students: Users can add new students to the database with unique roll numbers.
-
View Students: Display the details of all the students stored in the database.
-
Search Student: Implement a search functionality where users can search for a student by roll number and view their details.
-
Calculate Average Marks: Calculates and displays the average marks of all the students in the database.
-
Exception Handling: Handles exceptions such as negative marks or invalid roll numbers gracefully using custom exception classes.
- Clone the repository to your local machine.
git clone https://github.com/AdityaJ2305/StudentDatabase.git
-
Compile the Java files using any Java compiler.
-
Run the compiled Java program.
-
Follow the instructions prompted by the program to perform various operations such as adding students, viewing students, searching for students, and calculating average marks.
-
Student.java
: Contains theStudent
class definition with attributes and methods. -
StudentDatabase.java
: Main Java file implementing the student database management system with functionalities like adding, viewing, searching, and calculating average marks. -
README.md
: Instructions and information about the project.
-
To add a new student, select the option for adding students and provide necessary details like name, roll number, age, and marks.
-
To view all students, select the option for viewing students.
-
To search for a specific student, choose the search option and input the roll number of the student.
-
To calculate the average marks of all students, select the respective option.
// Example usage of the Student class
Student student1 = new Student("John Doe", 25, 20, 85);
- Java Development Kit (JDK)
- Aditya Jindal
This project is licensed under the MIT License - see the LICENSE
file for details.