Java student management system
Java SEComprehensive case: student management system.
To viewProblem solving steps、Source codePlease check the original text,Link to original text
The main functions of the system are as follows:
- Define aaggregateThe container is used to store all studentsobjectInformation operation.
- Add students: input student information through the keyboard and add it to the collection.
- Delete student: enter the student number of the student to be deleted through the keyboard, and delete the student object from the collection.
- Modify student: input the student number of the student to be modified through the keyboard, and modify other information of the student object.
- View students: display the student object information in the collection.
- Exit system: end the program.
- In the main method, the general interface of the system is designedswitchStatement to execute the corresponding operation according to the user’s choice.
- Define two commonmethod, which is used to judge whether the student number is repeated or not and to obtain the index of the object in the collection.
- Define add students, delete students, modify students and view students respectively.
Defining student classes
The realization of student information management system
When the student information is not added, other operations will return the prompt that the student is empty (only one is shown here). The operation is as follows:
Add student information (add 3 student information, only one is shown here), and run as follows:
Query student information, run as follows:
When deleting or updating student information, if the student number entered does not exist, the user will be prompted that the student does not exist and ask the user whether to continue (only one is shown here). The operation is as follows:
Delete student information and run as follows:
After deleting the student information, query the student information. At this time, it is found that the student information with student number 03 has been deleted. The operation is as follows:
Modify student information, run as follows:
After modifying the student information, query the student information. At this time, it is found that the student information with student number 01 has been changed. The operation is as follows:
Finally, exit the system and run as follows:
The above cases use Java se knowledge to realize a simple student information management system.
This work adoptsCC agreementThe author and the link to this article must be indicated in the reprint