欢迎来到天天文库
浏览记录
ID:59188047
大小:15.81 KB
页数:18页
时间:2020-10-30
《学生信息管理系统源代码.docx》由会员上传分享,免费在线阅读,更多相关内容在教育资源-天天文库。
1、学生信息管理系统源代码importjava.io.*;classStuInfo{publicStringname;publicintnumber;publicStringsex;publicStringage;publicStringbir;publicStringemail;publicStringaddr;publicStringtel;publicStringgetName(){returnname;}publicvoidsetName(Stringname){this.name=name;}publicintget
2、Number(){returnnumber;}publicvoidsetNumber(intnumber){this.number=number;}publicStringgetSex(){returnsex;}publicvoidsetSex(Stringsex){this.sex=sex;}publicStringgetAge(){returnage;}publicvoidsetAge(Stringage){this.age=age;}publicStringgetBir(){returnbir;}publicvoid
3、setBir(Stringbir){this.bir=bir;}publicStringgetEmail(){returnemail;}publicvoidsetEmail(Stringemail){this.email=email;}publicStringgetAddr(){returnaddr;}publicvoidsetAddr(Stringaddr){this.addr=addr;}publicStringgetTel(){returntel;}publicvoidsetTel(Stringtel){this.t
4、el=tel;}}publicclassStudent{privatestaticPrintStreamout=System.out;privatestaticStringfilename="Stu.txt";privatestaticinttotal=0;privatestaticintrt=0;//recylelengthprivateStuInfo[]stuInfos;privateStuInfo[]recycle;BufferedReaderbuf=newBufferedReader(newInputStreamR
5、eader(System.in));//创建缓冲流publicStudent(){stuInfos=newStuInfo[11];}publicvoid信息录入(){BufferedReaderbuf=newBufferedReader(newInputStreamReader(System.in));try{System.out.print("请输入学生信息(以0结束)");System.out.print("学号:");StuInfostu=newStuInfo();stu.setNumber(Intege
6、r.parseInt(buf.readLine()));while(stu.getNumber()!=0){System.out.print("姓名:");stu.setName(buf.readLine());System.out.print("性别:");stu.setSex(buf.readLine());System.out.print("年龄:");stu.setAge(buf.readLine());System.out.print("生日:");stu.setBir(buf.r
7、eadLine());System.out.print("邮箱:");stu.setEmail(buf.readLine());System.out.print("地址:");stu.setAddr(buf.readLine());System.out.print("电话:");stu.setTel(buf.readLine());//添加其他输入信息stuInfos[total]=stu;total++;stu=newStuInfo();System.out.print("请输入下一个学生信息
8、(以0结束)");System.out.print("姓名:");stu.setName(buf.readLine());}}catch(Exceptione){out.print(e);}}publicvoid保存数据(){try{FileWriterfwr=newFileWriter(fil
此文档下载收益归作者所有