學(xué)生信息管理系統(tǒng)Java基礎(chǔ)版數(shù)據(jù)庫_第1頁
學(xué)生信息管理系統(tǒng)Java基礎(chǔ)版數(shù)據(jù)庫_第2頁
學(xué)生信息管理系統(tǒng)Java基礎(chǔ)版數(shù)據(jù)庫_第3頁
學(xué)生信息管理系統(tǒng)Java基礎(chǔ)版數(shù)據(jù)庫_第4頁
學(xué)生信息管理系統(tǒng)Java基礎(chǔ)版數(shù)據(jù)庫_第5頁
已閱讀5頁,還剩4頁未讀, 繼續(xù)免費(fèi)閱讀

下載本文檔

版權(quán)說明:本文檔由用戶提供并上傳,收益歸屬內(nèi)容提供方,若內(nèi)容存在侵權(quán),請(qǐng)進(jìn)行舉報(bào)或認(rèn)領(lǐng)

文檔簡介

1、pub I i c cI ass StudentManagerMethod /*學(xué)生信息管理系統(tǒng)(簡易,無數(shù)據(jù)庫)用戶名為:2010031 密碼為:2010031* /(定義一個(gè)二維String類型數(shù)組,來保存學(xué)生的 信息 static String口 students=newString100 4;static int count=4;存放當(dāng)前的學(xué)生人數(shù)/打印一級(jí)菜單publ ic stat i c voi d pr i ntFi rstMenu ()/輸出一級(jí)菜單/打印二級(jí)菜單pub I i c stat i c vo i d pr i ntSecondMenu () (/輸出二級(jí)菜單/打

2、印三級(jí)菜單publ ic stat i c void pr i ntThi rdMenu() (/輸出第三級(jí)菜單I/定義初始化數(shù)據(jù)publ ic stat ic void initStudent ()StringEJ s1 = Hs00r', String口 s2=“s002”, String口 s3=Hs003H, String口 s4=“sOO4”, students0=s1;students1=s2; students2=s3;students3=s4;三四五偉 張李王張 t V t VX- 2 I f22班長”23干部”28旁聽”/查看學(xué)生信息pub I ic stat ic

3、void IookStudent ()for (int i=0; i<count; i +)for (int j-0;j<studentsi. Iength;j+)/添加學(xué)生信息pub Iic stat i c void addStudent ()/將用戶輸入的新學(xué)生信息構(gòu)造一個(gè)新的String數(shù)組 String口tmpStu2= stuNo2, stuName2, stuAge2, stuTitIe2;/將此新學(xué)生添加到二維數(shù)組中studentscount=tmpStu2;count+;/修改學(xué)生信息pub Iic stat i c void mod i fyStudent ()

4、/按學(xué)號(hào)查找對(duì)應(yīng)的學(xué)生信息_int changeCount=0;/標(biāo)記,作為所找學(xué)生的標(biāo)記 boolean changeF I ag=f a Ise;/ 標(biāo)記,決定是否修改 for (int i=0; i<count;i +)1 i f (studentsi0. equaIs(changeNo)for (int j=0;j<studentsi. length;j+)1 changeCount= i; changeFIag=true; break;/ 修改 if (changeFlag)String口tmpStu3= stuNo3, stuName3, stuAge3, stuTit

5、Ie3;students changeCount=tmpStu3;/顯示修改后的學(xué)生信息for (i nt i=0;i <count; i +) IookStudent ();e I se/查理學(xué)生信息/按學(xué)生學(xué)號(hào)查詢publ ic static void queryStudentNo ()Iboolean findFlagl=true;/標(biāo)記,用來顯示是否找 至lj for (int i=0; i<count; i+)i f (studentsi0. equaIs(f i ndNo) (for (i nt j=0;j<studentsi. Iength;j+) I1 f i

6、 ndFlagl=faIse; break;II if (findFlagl) I/按學(xué)生姓名查詢pub I ic stat i c void queryStudentName (),boolean f i ndFlag2=true;/標(biāo)記,用來顯ZF是否找到信心、for (int i=0; i<count;i +)II f(studentsi1. equaIs (f i ndName) 1 for (int j=O;j<studentsi. Iength;j+) IfindFlag2=false;1 if (icount) break;I1 if (findFIag2) I/按學(xué)

7、生年齡查詢pub I i c stat i c vo i dqueryStudentAge (),boolean findFlag3=true;/標(biāo)記,用來顯ZF是否找到信 息 for (i nt i=0;i<count;i+) (1 f (students i2. equaIs(f i ndAge)for (int j-0;j<studentsi. Iength;j+)f i ndFIag3=faIse;Iif (i-count)(break;IIif (findFlag3)(/按學(xué)生職務(wù)查詢pub Ii c stat i c vo i d queryStudentT i 11e

8、 () Iboo I ean f indFI ag4=true; 標(biāo)記,用來顯示是否找到信息 for (i nt i=0; i<count;i +) (i 千(studentsi3. equaIs(f i ndT i11e) (for (int j=0;j<studentsi. Iength;j+) I If i ndFIag4=fa Ise;Iif (i-count)(break;rif (findFIag4)/刪除學(xué)生信息pub Ii c stat i c vo i d de IeteStudent ()/按學(xué)號(hào)查找對(duì)應(yīng)的學(xué)生信息、_、int deleteCount=0;/標(biāo)記

9、,作為所找學(xué)生的標(biāo)記booleande leteFlag=fa Ise;/ 標(biāo)記,決定是否刪除for (int i =0; icount;i +)i f (students i0. equaIs(de IeteNo)for (int j=0;j<students i. Iength;j+)de IeteCount= i;/ de IeteFIag=true; break;/刪除i f (de I eteF I ag) (for(int j=deIeteCount+1;j<studentscount. Iength;j+) (students de IeteCount=student

10、sj; de IeteCount+;count;/顯示刪除后的學(xué)生信息I ookStudent ();Ie I se/驗(yàn)證登錄信息pub Iic stat i c boo Iean ver i fyStudent ()boolean ver i fyFIag=faIse;i f("2010031 equaIs(userName)&&"2010031 equaIs (password)ver i fyFIag=true;return ver ifyFlag;pub I i c stat i c vo i d ma i n (Str i ng args) /ma

11、in 函數(shù) initStudent 0 ;/ 初始化學(xué)生信息數(shù)組boolean fi rstFlag=false;/標(biāo)記位,據(jù)此決定是否退出一級(jí)菜單while (true)pr i ntFi rstMenu () ;/ 打印一級(jí)菜單 switch (f i rstChoice) (case 1:boolean FIag1 =ver ifyStudent () ;/控制輸出二級(jí)菜單(驗(yàn)證通過會(huì) 輸出)if (Flag!)boolean secondFIag=true;/標(biāo)記位,決定是否退出二級(jí)菜單 do pr i ntSecondMenu () ;/ 打印二級(jí)菜單 swi tch (second

12、Cho i ce):”);case1:/查看學(xué)生信息I ookStudent ();if (backl-0)break;break;2:/添加學(xué)生信息addStudent ();/顯示添加后的學(xué)生信息for (int i =0; i <count; i +)for (int j-0;j<studentsi. Iength;j+) i f (back2-0)break;break;case3:/修改學(xué)生信息mod i fyStudent ();:");i f (back3-0) break;break;case 4:/ 查詢學(xué)生信息 _boolean thi "F

13、lag=fa Ise;/標(biāo)記,決定是否退出第三 級(jí)菜單while (true) Ipr intThirdMenuO ;/打印三級(jí)菜單 swi tch(th i rdCho i ce)case 1 :/ 按學(xué)生學(xué)號(hào)查詢 queryStudentNo (); >:”);if (back4-0)break; )break;case 2:/ 按學(xué)生姓名 查詢if (back5-0) <break; )break;case 3:/按學(xué)生年齡 查詢 queryStudentAge (); if (back6-0)break; )case 4:/按學(xué)生職務(wù) 查詢queryStudentT i 11 e () if (back7=0)break;,break;case 5:/ 退出第三級(jí) 菜單th i rdFIag=true;break;default:break;Ii f (th i rdFIag) break;)break;case 5:/刪除學(xué)生信息de

溫馨提示

  • 1. 本站所有資源如無特殊說明,都需要本地電腦安裝OFFICE2007和PDF閱讀器。圖紙軟件為CAD,CAXA,PROE,UG,SolidWorks等.壓縮文件請(qǐng)下載最新的WinRAR軟件解壓。
  • 2. 本站的文檔不包含任何第三方提供的附件圖紙等,如果需要附件,請(qǐng)聯(lián)系上傳者。文件的所有權(quán)益歸上傳用戶所有。
  • 3. 本站RAR壓縮包中若帶圖紙,網(wǎng)頁內(nèi)容里面會(huì)有圖紙預(yù)覽,若沒有圖紙預(yù)覽就沒有圖紙。
  • 4. 未經(jīng)權(quán)益所有人同意不得將文件中的內(nèi)容挪作商業(yè)或盈利用途。
  • 5. 人人文庫網(wǎng)僅提供信息存儲(chǔ)空間,僅對(duì)用戶上傳內(nèi)容的表現(xiàn)方式做保護(hù)處理,對(duì)用戶上傳分享的文檔內(nèi)容本身不做任何修改或編輯,并不能對(duì)任何下載內(nèi)容負(fù)責(zé)。
  • 6. 下載文件中如有侵權(quán)或不適當(dāng)內(nèi)容,請(qǐng)與我們聯(lián)系,我們立即糾正。
  • 7. 本站不保證下載資源的準(zhǔn)確性、安全性和完整性, 同時(shí)也不承擔(dān)用戶因使用這些下載資源對(duì)自己和他人造成任何形式的傷害或損失。

評(píng)論

0/150

提交評(píng)論