Java Implement student management system — Console Edition :
You can add, delete, modify and query student information .
For some logic problems , For example, after modifying to non-existent students , Prompt to return ....
The screenshot of the program result is as follows :

The code is as follows :
package Student; public class Student { // Student ID private String sid; // full name private
String name; // Age private String age; // Place of residence private String address; // grade private
String grade; // Professional information private String major; public Student(){ } public Student(
String sid, String name, String age, String address, String grade, String major)
{ this.sid = sid; this.name = name; this.age = age; this.address = address; this
.grade = grade; this.major = major; } public String getSid() { return sid; }
public void setSid(String sid) { this.sid = sid; } public String getName() {
return name; } public void setName(String name) { this.name = name; } public
String getAge() { return age; } public void setAge(String age) { this.age = age;
} public String getAddress() { return address; } public void setAddress(String
address) { this.address = address; } public String getGrade() { return grade; }
public void setGrade(String grade) { this.grade = grade; } public String
getMajor() { return major; } public void setMajor(String major) { this.major =
major; } } package Student; import java.util.ArrayList; import java.util.Scanner
; public class StudentManager { public static void main(String[] args) { //
Create student object , Used to store student data ArrayList<Student> array = new ArrayList<>(); while(true){ //
main interface System.out.println("------ Welcome to the student management system ------"); System.out.println("1. Add student ");
System.out.println("2. Delete student "); System.out.println("3. Modify student "); System.out.println(
"4. View all students "); System.out.println("5. Search student information "); System.out.println("6. sign out "); System.
out.println(" Please enter your choice :"); // use Scanner Keyboard entry Scanner scanner = new Scanner(System.
in); String line = scanner.nextLine(); // use switch Statement to complete the selection operation switch(line){ case"1":
// System.out.println(" Add student "); addStudent(array); break; case"2": //
System.out.println(" Delete student "); deleteStudent(array); break; case"3": //
System.out.println(" Modify student "); updateStudent(array); break; case"4": //
System.out.println(" View all students "); findAllStudent(array); break; case"5": findStudent
(array); break; case"6": System.out.println(" Thanks for using "); System.exit(0);//jvm sign out . } }
} // Define a method , Used to add student information . public static void addStudent(ArrayList<Student> array){
// Create and input data information of Student object , Display promotion information , Promote what information to enter Scanner scanner = new Scanner(System.in);
String sid; // To get the program back here , We use loop implementation while(true){ System.out.println(" Please enter student ID :");
sid= scanner.nextLine(); boolean flag = isUsed(array,sid); if (flag){ System.
out.println(" Student ID has been used , Please input again :"); }else { break; } } System.out.println(" Please enter student name :")
; String name = scanner.nextLine(); System.out.println(" Please enter student age :"); String age =
scanner.nextLine(); System.out.println(" Please enter student grade :"); String grade = scanner.
nextLine(); System.out.println(" Please enter student major "); String major = scanner.nextLine();
System.out.println(" Please enter the student residence :"); String address = scanner.nextLine();
// Create student object , Assign the data entered in the keyboard to the member variable of a student object Student student = new Student(); student.setSid(
sid); student.setName(name); student.setAge(age); student.setGrade(grade);
student.setMajor(major); student.setAddress(address); // Add student object to collection array.add(
student); // Give the successful promotion System.out.println(" Student added successfully !"); } // Define a method , Judge whether the student ID is used
public static boolean isUsed(ArrayList<Student> array,String sid){ boolean flag=
false; for (int i = 0; i < array.size(); i++) { Student student = array.get(i);
if (student.getSid().equals(sid)){ flag = true; break; } } return flag; } // Delete student
public static void deleteStudent(ArrayList<Student> array){ // Enter the student information to delete here .
Scanner scanner = new Scanner(System.in); System.out.println(" Please enter the student ID you want to delete :");
String sid = scanner.nextLine(); // Delete the corresponding object from the collection after traversing the collection . int index=-1; for (int i
= 0; i < array.size(); i++) { Student student = array.get(i); if (student.getSid
().equals(sid)){// compare index = i; break; } } if (index==-1){ System.out.println(
" The information does not exist , Please re-enter !"); }else { array.remove(index); System.out.println(" Delete student succeeded "); } }
// View all students public static void findAllStudent(ArrayList<Student> array){ if (array.
size()==0){ System.out.println(" No data , Please add information first "); return; } System.out.println(
" Student ID \t\t\t full name \t\t Age \t\t grade \t\t major \t\t Place of residence "); for (int i = 0; i < array.size(); i++) {
Student student = array.get(i); System.out.println(student.getSid()+"\t\t"+
student.getName()+"\t\t"+ student.getAge()+" year "+"\t"+student.getGrade()+"\t"+
student.getMajor()+"\t"+ student.getAddress()); } } // Modify student information public static void
updateStudent(ArrayList<Student> array){ // Key in the student ID to be modified Scanner scanner = new
Scanner(System.in); System.out.println(" Please enter the student ID to be modified :"); String sid = scanner.
nextLine(); for (int i = 0; i < array.size(); i++) { Student s = array.get(i);
if (!s.getSid().equals(sid)){ System.out.println(" Without this student , Input error "); return; } } //
Keyboard entry of modified information System.out.println(" Please enter student name :"); String name = scanner.nextLine();
System.out.println(" Please enter student age :"); String age = scanner.nextLine(); System.out.
println(" Please enter student grade :"); String grade = scanner.nextLine(); System.out.println(
" Please enter student major "); String major = scanner.nextLine(); System.out.println(" Please enter the student residence :");
String address = scanner.nextLine(); // Create student object Student student = new Student();
student.setSid(sid); student.setName(name); student.setAge(age); student.
setGrade(grade); student.setMajor(major); student.setAddress(address); // Traversal information
for (int i = 0; i < array.size(); i++) { Student student1 = array.get(i); if (
student1.getSid().equals(sid)){ array.set(i,student); break; } } System.out.
println(" Modified successfully "); } // Find students public static void findStudent(ArrayList<Student>
array){ Scanner scanner = new Scanner(System.in); if (array.size()==0){ System.
out.println(" No data , Please add information first "); return; } System.out.println(" Enter the student ID you want to find :"); String
sid= scanner.nextLine(); System.out.println(
" Student ID \t\t\t full name \t\t Age \t\t grade \t\t major \t\t Place of residence "); for (int i = 0; i < array.size(); i++) {
Student student = array.get(i); if (student.getSid().equals(sid)) System.out.
println(student.getSid()+"\t\t"+ student.getName()+"\t\t"+ student.getAge()+" year "+
"\t"+student.getGrade()+"\t"+student.getMajor()+"\t"+ student.getAddress()); } }
}
Talk is cheap, show me the code! —— Firewood studio !

Technology
©2019-2020 Toolsou All rights reserved,
Dynamic Simple registration login interface HTML+CSS+JQCSS Implement overflow display ellipsis 802.11 CCA and NAV mechanism Programmer refused due to low salary offer,HR become shame , Netizens instantly blew up ..abaqus Value of mass scaling factor _ABAQUS Mass scaling for Java Student information management system console version C Classic topics of language —— Insert a number into the sorted array Computer level 1 multi-point , How many points can I pass the computer test level 1 VINS-Fusion run kitti stereo and stereo+GPS data TS stay vue2 Writing in the project