欢迎来到天天文库
浏览记录
ID:40559038
大小:37.00 KB
页数:4页
时间:2019-08-04
《java学生信息管理基于eclipse环境》由会员上传分享,免费在线阅读,更多相关内容在教育资源-天天文库。
1、一个项目里,建6个类每个类对应一个操作~1添加:packageStudent_M;importjava.util.Scanner;publicclassAddMessage{InputMessageIM=newInputMessage();publicvoidaddMessage(){Stringaddstr;Scannersc=newScanner(System.in);System.out.println("请输入要添加的学生信息!");addstr=sc.next();for(inti=0;i2、.sum_stu.length;i++){if(IM.sum_stu[i]==null){IM.sum_stu[i]=addstr;System.out.println("添加成功!");}}}}2删除:packageStudent_M;importjava.util.Scanner;publicclassDeleteMessage{ShowMessageSM=newShowMessage();InputMessageIM=newInputMessage();publicstaticStringdelet3、e_stu;publicvoiddeleteMessage(){inti,j;Scannersc=newScanner(System.in);System.out.println("请输入要删除的学生的信息:");delete_stu=sc.next();for(i=0;i4、信息:packageStudent_M;importjava.io.*;importjava.util.Scanner;publicclassInputMessage{publicstaticString[]sum_stu;publicstaticintn;voidinputMessage(){Stringstu;System.out.println("你要输入的学生人数:");Scannersc=newScanner(System.in);n=sc.nextInt();sum_stu=newString5、[n];for(inti=1;i<=n;i++){System.out.println("请输入学生姓名,学号,班级(信息用逗号隔开):");stu=sc.next();sum_stu[i-1]=stu;}}}4查询:packageStudent_M;importjava.io.*;importjava.util.Scanner;publicclassSearchMessage{staticintj;publicvoidsearch_stu(){InputMessageIM=newInputMessage6、();Stringsearchname;Scannersc=newScanner(System.in);System.out.println("请输入要查询的学生信息:");searchname=sc.next();for(inti=0;i7、packageStudent_M;importjava.util.Scanner;publicclassShow{InputMessageIM=newInputMessage();ShowMessageSM=newShowMessage();DeleteMessageDM=newDeleteMessage();AddMessageAM=newAddMessage();SearchMessageSE=newSearchMessage();voidshow(){inti;for(i=1;i<=6;i++){S8、ystem.out.println("[1]输入学生信息[2]显示学生信息[3]删除学生信息[4]添加学生信息[5]查询学生成绩[6]退出");Scannersc=newScanner(System.in);intchoice=sc.nextInt();if(choice==6)break;switch(choice){case1:IM.inputMessage();break;case2:SM.showMessage();b
2、.sum_stu.length;i++){if(IM.sum_stu[i]==null){IM.sum_stu[i]=addstr;System.out.println("添加成功!");}}}}2删除:packageStudent_M;importjava.util.Scanner;publicclassDeleteMessage{ShowMessageSM=newShowMessage();InputMessageIM=newInputMessage();publicstaticStringdelet
3、e_stu;publicvoiddeleteMessage(){inti,j;Scannersc=newScanner(System.in);System.out.println("请输入要删除的学生的信息:");delete_stu=sc.next();for(i=0;i4、信息:packageStudent_M;importjava.io.*;importjava.util.Scanner;publicclassInputMessage{publicstaticString[]sum_stu;publicstaticintn;voidinputMessage(){Stringstu;System.out.println("你要输入的学生人数:");Scannersc=newScanner(System.in);n=sc.nextInt();sum_stu=newString5、[n];for(inti=1;i<=n;i++){System.out.println("请输入学生姓名,学号,班级(信息用逗号隔开):");stu=sc.next();sum_stu[i-1]=stu;}}}4查询:packageStudent_M;importjava.io.*;importjava.util.Scanner;publicclassSearchMessage{staticintj;publicvoidsearch_stu(){InputMessageIM=newInputMessage6、();Stringsearchname;Scannersc=newScanner(System.in);System.out.println("请输入要查询的学生信息:");searchname=sc.next();for(inti=0;i7、packageStudent_M;importjava.util.Scanner;publicclassShow{InputMessageIM=newInputMessage();ShowMessageSM=newShowMessage();DeleteMessageDM=newDeleteMessage();AddMessageAM=newAddMessage();SearchMessageSE=newSearchMessage();voidshow(){inti;for(i=1;i<=6;i++){S8、ystem.out.println("[1]输入学生信息[2]显示学生信息[3]删除学生信息[4]添加学生信息[5]查询学生成绩[6]退出");Scannersc=newScanner(System.in);intchoice=sc.nextInt();if(choice==6)break;switch(choice){case1:IM.inputMessage();break;case2:SM.showMessage();b
4、信息:packageStudent_M;importjava.io.*;importjava.util.Scanner;publicclassInputMessage{publicstaticString[]sum_stu;publicstaticintn;voidinputMessage(){Stringstu;System.out.println("你要输入的学生人数:");Scannersc=newScanner(System.in);n=sc.nextInt();sum_stu=newString
5、[n];for(inti=1;i<=n;i++){System.out.println("请输入学生姓名,学号,班级(信息用逗号隔开):");stu=sc.next();sum_stu[i-1]=stu;}}}4查询:packageStudent_M;importjava.io.*;importjava.util.Scanner;publicclassSearchMessage{staticintj;publicvoidsearch_stu(){InputMessageIM=newInputMessage
6、();Stringsearchname;Scannersc=newScanner(System.in);System.out.println("请输入要查询的学生信息:");searchname=sc.next();for(inti=0;i7、packageStudent_M;importjava.util.Scanner;publicclassShow{InputMessageIM=newInputMessage();ShowMessageSM=newShowMessage();DeleteMessageDM=newDeleteMessage();AddMessageAM=newAddMessage();SearchMessageSE=newSearchMessage();voidshow(){inti;for(i=1;i<=6;i++){S8、ystem.out.println("[1]输入学生信息[2]显示学生信息[3]删除学生信息[4]添加学生信息[5]查询学生成绩[6]退出");Scannersc=newScanner(System.in);intchoice=sc.nextInt();if(choice==6)break;switch(choice){case1:IM.inputMessage();break;case2:SM.showMessage();b
7、packageStudent_M;importjava.util.Scanner;publicclassShow{InputMessageIM=newInputMessage();ShowMessageSM=newShowMessage();DeleteMessageDM=newDeleteMessage();AddMessageAM=newAddMessage();SearchMessageSE=newSearchMessage();voidshow(){inti;for(i=1;i<=6;i++){S
8、ystem.out.println("[1]输入学生信息[2]显示学生信息[3]删除学生信息[4]添加学生信息[5]查询学生成绩[6]退出");Scannersc=newScanner(System.in);intchoice=sc.nextInt();if(choice==6)break;switch(choice){case1:IM.inputMessage();break;case2:SM.showMessage();b
此文档下载收益归作者所有