欢迎来到天天文库
浏览记录
ID:9295297
大小:56.50 KB
页数:8页
时间:2018-04-27
《学生信息管理系统java代码》由会员上传分享,免费在线阅读,更多相关内容在教育资源-天天文库。
1、本学生信息管理系统代码主要实现以下5个主功能:"1.添加一个学生");"2.根据学号/姓名查找一个学生");"3.根据学号更新一个学生信息");"4.根据学号删除学生信息");"5.根据学号输入学生成绩");"99.退出");副功能主动显示计算平均分和总成绩(还需添加其他功能代码,请联系)publicclassStudent{privateStringname;privateStringxuehao;privateintage;privateintindex;privateintmath;privateintc
2、hinese;privateintenglish;privateintwuli;privateinthuaxue;privateintshengwu;privateintsum;privateintavg;publicvoidsetIndex(intindex){this.index=index;}publicintgetIndex(){returnthis.index;}publicvoidsetName(Stringname){//设置名字this.name=name;}publicStringgetNam
3、e(){returnthis.name;}publicvoidsetAge(intage){this.age=age;}publicintgetAge(){returnthis.age;}publicvoidsetXuehao(Stringxuehao){//设置学号this.xuehao=xuehao;}publicStringgetXuehao(){returnthis.xuehao;}publicvoidsetMath(intmath){this.math=math;}publicintgetMath()
4、{returnthis.math;}publicvoidsetChinese(intchinese){this.chinese=chinese;}publicintgetChinese(){returnthis.chinese;}publicvoidsetEnglish(intenglish){this.english=english;}publicintgetEnglish(){returnthis.english;}publicvoidsetWuli(intwuli){this.wuli=wuli;}pub
5、licintgetWuli(){returnthis.wuli;}publicvoidsetHuaxue(inthuaxue){this.huaxue=huaxue;}publicintgetHuaxue(){returnthis.huaxue;}publicvoidsetShengwu(intshengwu){this.shengwu=shengwu;}publicintgetShengwu(){returnthis.shengwu;}publicvoidsetSum(){this.sum=this.math
6、+this.chinese+this.english+this.wuli+this.huaxue+this.shengwu;}publicintgetSum(){returnthis.sum;}publicvoidsetAvg(){this.avg=sum/6;}publicintgetAvg(){returnthis.avg;}publicStringtoString(){Stringmsg="t"+this.xuehao+"tt"+this.name+"t"+this.age+"t"+this.m
7、ath+"t"+this.chinese+"t"+this.english+"t"+this.wuli+"t"+this.huaxue+"t"+this.shengwu+"t"+this.sum+"t"+this.avg;returnmsg;}}importjava.util.Scanner;publicclassAdmin{Scannerin=newScanner(System.in);Stringmsg="t学号tt姓名t年龄t数学t语文t英语t物理t化学t生物t总成绩
8、t平均分";publicvoidprint(Student[]arr){System.out.println(msg);for(inti=0;i
此文档下载收益归作者所有