Skip to content

Latest commit

 

History

2 Commits

Folders and files

NameName
Last commit message
Last commit date
 
 
 
 

Repository files navigation

Student Record Management System (Java CLI)

Objective

This project is a CLI-based CRUD system for managing student records.
It demonstrates how to use classes, ArrayList, loops, and methods in Java to build a menu-driven application.


Tools Used

  • Java (JDK)
  • VS Code
  • Terminal

Files

  • StudentRecordManagement.java → Main program file
  • Student class → Represents a student entity with fields (ID, Name, Marks)

Features Implemented

  1. Add Student

    • Takes input from the user (ID, Name, Marks) using Scanner.
    • Stores the student as an object in an ArrayList.
  2. View Students

    • Prints all student records.
    • Used Enhanced For Loop for simplicity.
    • toString() method is overridden in Student class to display student details cleanly.
  3. Update Student

    • Searches for a student by ID.
    • If found, updates name and marks.
    • Used Enhanced For Loop for iteration.
  4. Delete Student

    • Searches student by ID and deletes the record from ArrayList using remove() method.
    • students.remove(s) is used because it directly removes the matching object.
  5. Exit Option

    • Gracefully terminates the program.

Why These Concepts Are Used?

  • Class Student → To represent real-world entities (ID, name, marks) as objects.
  • ArrayList → Dynamic data structure to store multiple student objects, supports add/remove easily.
  • Enhanced For Loop → Cleaner and shorter than traditional for loop when traversing the list.
  • toString() Method Override → Allows direct printing of student details without extra formatting code.
  • remove() Method → Deletes a specific student object from the list.
  • Scanner → For console input (CLI-based interaction).
  • While Loop with Menu → Provides continuous interaction until user chooses exit.

How to Run

  1. Open terminal in project folder.
  2. Compile the program:
    javac StudentRecordManagement.java
    
    

Sample Output

=== Student Record Management System ===

  1. Add Student
  2. View Students
  3. Update Student
  4. Delete Student
  5. Exit Enter your choice:1

Enter Student ID: 1 Enter Student Name: Radha Enter Student Marks: 98 Student added successfully!

=== Student Record Management System ===

  1. Add Student
  2. View Students
  3. Update Student
  4. Delete Student
  5. Exit Enter your choice: 2

--- Student Records --- ID: 1, Name: Radha, Marks: 98.0

About

No description, website, or topics provided.

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages