學(xué)生成績管理系統(tǒng)(java語言).doc

學(xué)生成績管理系統(tǒng)(java語言).doc

ID:51869304

大?。?7.00 KB

頁數(shù):3頁

時(shí)間:2020-03-17

學(xué)生成績管理系統(tǒng)(java語言).doc_第1頁
學(xué)生成績管理系統(tǒng)(java語言).doc_第2頁
學(xué)生成績管理系統(tǒng)(java語言).doc_第3頁
資源描述:

《學(xué)生成績管理系統(tǒng)(java語言).doc》由會員上傳分享,免費(fèi)在線閱讀,更多相關(guān)內(nèi)容在行業(yè)資料-天天文庫。

1、學(xué)生成績管理系統(tǒng)importjava.util.*;importjava.io.*;classStudentimplementsSerializable{Stringname;longno;privateString[]course={"os","java","math"};double[]cscore={0,0,0};publicStudent(Stringname,longno,doublea,doubleb,doublec){this.name=name;this.no=no;this.cscore[0]=a;this.cscore[

2、1]=b;this.cscore[2]=c;}@OverridepublicStringtoString(){returnthis.name+""+this.no+""+this.course[0]+":"+this.cscore[0]+""+this.course[1]+":"+this.cscore[1]+""+this.course[2]+":"+this.cscore[2];}}publicclassObject{privatestaticScannerscanner=newScanner(System.in);publicStud

3、ent[]read()throwsException{ObjectInputStreamobjIn=newObjectInputStream(newFileInputStream("stus.data"));intnum=objIn.readInt();Student[]stus=newStudent[num];for(inti=0;i

4、owsException{Student[]s=newStudent[stus.length+1];for(inti=0;i

5、tem.out.print("java成績:");doublecscore1=scanner.nextDouble();System.out.print("math成績:");doublecscore2=scanner.nextDouble();s[s.length-1]=newStudent(name,no,cscore0,cscore1,cscore2);save(s);System.out.println("添加成功!");}3publicvoiddispAll(Student[]stus){System.out.println("現(xiàn)

6、有Student信息為:");for(Studentstu:stus){System.out.println(stu);}}publicvoidsave(Student[]stus)throwsException{ObjectOutputStreamobjOut=newObjectOutputStream(newFileOutputStream("stus.data"));objOut.writeInt(stus.length);for(Studentstu:stus){objOut.writeObject(stu);}objOut.clo

7、se();}publicvoidfindById(Student[]stus){intno=0,i=0;System.out.print("請輸入學(xué)號:");no=scanner.nextInt();for(i=0;i

8、udent[]stus){Stringname="";System.out.print("請輸入姓名:");name=scanner.next();for(inti=0;i

當(dāng)前文檔最多預(yù)覽五頁,下載文檔查看全文

此文檔下載收益歸作者所有

當(dāng)前文檔最多預(yù)覽五頁,下載文檔查看全文
溫馨提示:
1. 部分包含數(shù)學(xué)公式或PPT動畫的文件,查看預(yù)覽時(shí)可能會顯示錯(cuò)亂或異常,文件下載后無此問題,請放心下載。
2. 本文檔由用戶上傳,版權(quán)歸屬用戶,天天文庫負(fù)責(zé)整理代發(fā)布。如果您對本文檔版權(quán)有爭議請及時(shí)聯(lián)系客服。
3. 下載前請仔細(xì)閱讀文檔內(nèi)容,確認(rèn)文檔內(nèi)容符合您的需求后進(jìn)行下載,若出現(xiàn)內(nèi)容與標(biāo)題不符可向本站投訴處理。
4. 下載文檔時(shí)可能由于網(wǎng)絡(luò)波動等原因無法下載或下載錯(cuò)誤,付費(fèi)完成后未能成功下載的用戶請聯(lián)系客服處理。