The Student Management System is a simple Java-based application designed to manage student and teacher information. This system allows users to add, delete, and update student records, as well as display all student information. It utilizes Object-Oriented Programming (OOP) concepts such as inheritance, classes, and methods to organize the functionality. The project includes the following core classes:
- Person: A base class representing common attributes (name and age) for all people.
- Student: A subclass of
Personrepresenting a student with additional attributes such asidandgrade. - Teacher: A subclass of
Personrepresenting a teacher with additional attributes such assectionandsalary. - StudentManagement: A class that manages an array of students, including methods for adding, deleting, and updating student records.
- Represents a generic person with basic attributes:
nameandage. - Includes getters and setters for these attributes.
- Inherits from
Personand adds additional attributes:idandgrade. - Methods to get and set
idandgrade. - Additional methods such as
addStudent,deleteStudent, anddisplayStudentcan be added to manage students effectively.
- Inherits from
Personand adds additional attributes:sectionandsalary. - Methods to get and set
sectionandsalary. - Additional methods such as
addTeacher,deleteTeacher, anddisplayTeachercan be added to manage teachers effectively.
- Manages an array of students with the following functionality:
- Add a Student: Adds a new student to the system with name, age, ID, and grade.
- Delete a Student: Deletes a student by their ID and shifts the remaining students accordingly.
- Change Student Information: Allows modification of a student's information, either fully or partially.
- Display Students: Displays the information of all students currently in the system.
- Method Overloading: Includes an overloaded
changeStudentInfomethod that allows changing only the student's name.
- Java 8 or higher
-
Clone the repository:
git clone https://github.com/yourusername/student-management-system.git
-
Compile and run the Java program:
- Use your favorite IDE (e.g., IntelliJ IDEA, Eclipse) or the command line to compile and run the
StudentManagementclass. - Example commands:
javac StudentManagement.java java StudentManagement
- Use your favorite IDE (e.g., IntelliJ IDEA, Eclipse) or the command line to compile and run the
-
Add students, delete students, and update student information using the methods defined in the
StudentManagementclass.
StudentManagement studentSystem = new StudentManagement(10);
// Add students
studentSystem.addStudent("John Doe", 20, 101, 85.5);
studentSystem.addStudent("Jane Smith", 22, 102, 90.2);
// Display all students
studentSystem.displayStudents();
// Change student info
studentSystem.changeStudentInfo(101, "John Doe Updated", 21, 88.5);
// Delete a student
studentSystem.deleteStudent(102);
// Display all students again
studentSystem.displayStudents();