This Java program allows you to manage student records through a simple menu-driven interface. You can add, view, search, update, and delete student records stored in a text file (dataset.txt).
- Add a Student Record: Add a new student record with details such as roll number, name, phone number, age, and city.
- View All Records: Display all student records stored in the
dataset.txtfile. - Search a Record by Roll Number: Search for a student record by their roll number.
- Update a Record: Update the details of an existing student record identified by their roll number.
- Delete a Record: Delete a student record by their roll number.
- Exit: Exit the program.
-
Compile and Run the Program:
- Open a terminal or command prompt.
- Navigate to the directory containing the
Dataset.javafile. - Compile the program using the following command:
javac Dataset.java
- Run the program using the following command:
java Dataset
-
Interact with the Menu:
- When the program runs, a menu with options will be displayed.
- Enter the number corresponding to the action you want to perform and follow the prompts.
- Select option
1to add a new student record. - Enter the student's roll number, name, phone number, age, and city when prompted.
- The record will be saved to the
dataset.txtfile.
- Select option
2to view all student records. - All records stored in
dataset.txtwill be displayed.
- Select option
3to search for a student record by roll number. - Enter the roll number of the student you want to search for.
- The program will display the record if found; otherwise, it will indicate that the record was not found.
- Select option
4to update a student record. - Enter the roll number of the student whose record you want to update.
- If the record is found, enter the new details for the student.
- The record will be updated in the
dataset.txtfile.
- Select option
5to delete a student record. - Enter the roll number of the student whose record you want to delete.
- If the record is found, it will be deleted from the
dataset.txtfile.
- Select option
6to exit the program. - The program will close the resources and exit.
Dataset.java: The main Java program file.dataset.txt: The text file where student records are stored. This file is created automatically if it does not exist.
- Java Development Kit (JDK) installed on your system.
Contributions are welcome! If you find any issues or have suggestions for improvements, feel free to open an issue or submit a pull request.