This Java program implements a basic Student Database Management System. It allows users to add students, view the database, search for a student by roll number, calculate the average marks of all students, and exit the program.
- Clone the repository or download the
Main.java
file. - Compile the code using a Java compiler:
javac Main.java
- Run the compiled code:
java Main
- Add Student (Choice 1): Adds a new student to the database with information such as name, roll number, age, and marks.
- View Database (Choice 2): Displays the details of all students in the database.
- Search Student (Choice 3): Searches for a student based on the provided roll number.
- Calculate Average Marks (Choice 4): Computes and displays the average marks of all students in the database.
- Exit Loop (Choice 5): Exits the program.
- Choose an option by entering the corresponding number.
- Follow the prompts to input the required information.
1. Add Student :
2. View Database :
3. Search Student (Input roll number) :
4. Calculate Average Marks :
5. Exit Loop
Enter your choice : 1
Enter student name : John Doe
Enter roll number : 101
Enter age : 20
Enter marks : 85.5
Student added successfully!
1. Add Student :
2. View Database :
3. Search Student (Input roll number) :
4. Calculate Average Marks :
5. Exit Loop
Enter your choice : 2
************LIST************
Student Details:
Name: John Doe
Roll Number: 101
Age: 20
Marks: 85.5
*****************************
1. Add Student :
2. View Database :
3. Search Student (Input roll number) :
4. Calculate Average Marks :
5. Exit Loop
Enter your choice : 4
Average marks is 85.5