资源描述:
《java学生成绩管理系统.docx》由会员上传分享,免费在线阅读,更多相关内容在行业资料-天天文库。
1、importjava.util.Arrays;importjava.io.*;importjava.util.Scanner;publicclassOrder{Stringm[]=newString[5];Stringe[]=newString[5];Stringname[]=newString[5];Stringnum[]=newString[5];publicOrder(Stringm0,Stringm1,Stringm2,Stringm3,Stringm4,Stringe0,Stringe1,Stringe2,Stringe3,String
2、e4,Stringname0,Stringname1,Stringname2,Stringname3,Stringname4,Stringnum0,Stringnum1,Stringnum2,Stringnum3,Stringnum4){this.m[0]=m0;this.m[1]=m1;this.m[2]=m2;this.m[3]=m3;this.m[4]=m4;this.e[0]=e0;this.e[1]=e1;this.e[2]=e2;this.e[3]=e3;this.e[4]=e4;this.name[0]=name0;this.nam
3、e[1]=name1;this.name[2]=name2;this.name[3]=name3;this.name[4]=name4;this.num[0]=num0;this.num[1]=num1;this.num[2]=num2;this.num[3]=num3;this.num[4]=num4;}publicvoidFuc(){intm1=Integer.parseInt(m[0]);//将String类型强制转换为int,类型,否则readline不能读取int类型intm2=Integer.parseInt(m[1]);intm3=
4、Integer.parseInt(m[2]);intm4=Integer.parseInt(m[3]);intm5=Integer.parseInt(m[4]);inte1=Integer.parseInt(e[0]);inte2=Integer.parseInt(e[1]);inte3=Integer.parseInt(e[2]);inte4=Integer.parseInt(e[3]);inte5=Integer.parseInt(e[4]);Student[]st=newStudent[5];st[0]=newStudent(name[0]
5、,num[0],e1,m1);st[1]=newStudent(name[1],num[1],e2,m2);st[2]=newStudent(name[2],num[2],e3,m3);st[3]=newStudent(name[3],num[3],e4,m4);st[4]=newStudent(name[4],num[4],e5,m5);Arrays.sort(st);/*for(inti=0;i6、+num[0]+"英语:"+e1+"数学:"+m1+"总成绩:"+(e1+m1);Stringstr2="姓名:"+name[1]+"学号:"+num[1]+"英语:"+e2+"数学:"+m2+"总成绩:"+(e2+m2);Stringstr3="姓名:"+name[2]+"学号:"+num[2]+"英语:"+e3+"数学:"+m3+"总成绩:"+(e3+m3);Stringstr4="姓名:"+name[3]+"学号:"+num[3]+"英语:"+e4+"数学:"+m4+"总成绩:"+(e4+m4);Stringstr5="姓名:"+name[
7、4]+"学号:"+num[4]+"英语:"+e5+"数学:"+m5+"总成绩:"+(e5+m5);sinksout1=newsink("d:\Studentgrade\sort.txt");sout1.writeline(str1);sout1.writeline(str2);sout1.writeline(str3);sout1.writeline(str4);sout1.writeline(str5);sout1.close();inti;for(i=0;i<5;i++)System.out.println(st[i]);}}public
8、classResult{Stringy[]=newString[5];Stringm[]=newString[5];Result(Str