TOPIC
Create console based Java application on student management system
where you can add view and delete student records
SUBJECT
Core Java
Class: SY -BSC(IT) Year: 2023-24
This is to certify that the work entered in this report is the work of Shri / Kumari
IMAD HUSSAIN HASWARE of division ___B___ Roll No. __91__ Uni. Exam No.
_________ has satisfactorily completed and worked for Sem IV of the year 2023-24 in the
college laboratory.
Mrs. Poonam Parmar
Internal Examiner Internal Examiner Signature
Date: / / 2024 Department of :
INFORMATION TECHNOLOGY
Introduction: Student Management System
The Student Management System is a console-based Java application designed to streamline
the organization and administration of student records within an educational institution. This
application offers essential functionalities including adding, viewing, and deleting student
records, providing administrators with a convenient tool for managing student information
effectively.
Key Features:
Add Student Records: Administrators can input new student information such as name and
ID, allowing for seamless integration of new students into the system.
View Student Records: The application enables users to retrieve and display existing student
records, offering a comprehensive overview of the student body within the institution.
Delete Student Records: Administrators have the ability to remove outdated or erroneous
student records from the system, ensuring data accuracy and relevance.
How to Use:
Upon launching the application, users are presented with a user-friendly menu interface
where they can select their desired operation. Options include adding a new student record,
viewing existing student records, deleting student records, and exiting the application. The
system operates efficiently through simple user input and provides prompt feedback on
performed actions.
Purpose:
The Student Management System aims to simplify the process of managing student records,
offering a centralized platform for administrators to handle student information efficiently.
By automating tasks such as record creation, retrieval, and deletion, the system reduces
administrative burden and enhances overall productivity within educational institutions.
Conclusion:
With its intuitive interface and essential features, the Student Management System represents
a valuable asset for educational institutions seeking to optimize their administrative
processes. By facilitating the management of student records, the application contributes to
improved organization, accuracy, and efficiency in academic administration.
Flowchart:
Algorithm:
Step 1: Start
Step 2: Initialization
Create classes for Student and StudentManagementSystem.
Initialize an empty Array List students and a Scanner object scanner.
Step 3: Functionality Methods
addStudent(): Prompt user for name and ID, add new student to students.
viewStudents(): Display all student records if any.
deleteStudent(): Prompt user for student ID, delete matching record if found.
Step 5: Main Method
Create instance of StudentManagementSystem.
Use a loop to display menu options and handle user input.
Menu options: add, view, delete students, or exit.
Step 6: Exit
Provide an option to exit application.
Display exit message and terminate program execution.
This succinctly describes the steps involved in implementing the student management system.
Code:
import [Link];
import [Link];
class Student {
private String name;
private int age;
private String id;
public Student(String name, int age, String id) {
[Link] = name;
[Link] = age;
[Link] = id;
}
public String getName() {
return name;
}
public int getAge() {
return age;
}
public String getId() {
return id;
}
public String repeat(char c, int count){
StringBuilder sb=new StringBuilder();
for(int i=0;i<count;i++){
[Link](c);
}
return [Link]();
}
}
class StudentManagement {
private ArrayList<Student> students;
public StudentManagement() {
students = new ArrayList<>();
}
public void addStudent(Student student) {
[Link](student);
[Link]("Student added successfully.");
}
public void removeStudent(String id) {
for (Student student : students) {
if ([Link]().equals(id)) {
[Link](student);
[Link]("Student removed successfully.");
return;
}
}
[Link]("Student with ID " + id + " not found.");
}
public void displayStudents() {
if ([Link]()) {
[Link]("No students to display.");
return;
}
[Link]("List of students:");
for (Student student : students) {
String s=[Link]();
int i=[Link]();
char sp=' ',sy='═';
[Link]("╔═════════"+[Link](sy,i)+"╗");
[Link]("║ Name: "+[Link]()+" ║");
[Link]("║ Age: "+[Link]()+[Link](sp,i)+"║");
[Link]("║ ID: "+[Link]()+[Link](sp,i)+"║");
[Link]("╚═════════"+[Link](sy,i)+"╝");
}
}
}
public class StudentManagementSystem{
public static void main(String[] args) {
Scanner scanner = new Scanner([Link]);
StudentManagement sms = new StudentManagement();
while (true) {
[Link]("╔═════════════════════╗");
[Link]("║ 1. Add Student ║");
[Link]("║ 2. Remove Student ║");
[Link]("║ 3. Display Students ║");
[Link]("║ 4. Exit ║");
[Link]("╚═════════════════════╝");
[Link]("Enter your choice: ");
int choice = [Link]();
[Link]();
switch (choice) {
case 1:
[Link]("Enter student name: ");
String name = [Link]();
[Link]("Enter student age: ");
int age = [Link]();
[Link]();
[Link]("Enter student ID: ");
String id = [Link]();
[Link](new Student(name, age, id));
break;
case 2:
[Link]("Enter student ID to remove: ");
String removeId = [Link]();
[Link](removeId);
break;
case 3:
[Link]();
break;
case 4:
[Link]("Exiting program...");
[Link](0);
default:
[Link]("Invalid choice, please try again.");
}
}
}
}
Output: