C++學(xué)生管理系統(tǒng)_第1頁(yè)
C++學(xué)生管理系統(tǒng)_第2頁(yè)
C++學(xué)生管理系統(tǒng)_第3頁(yè)
C++學(xué)生管理系統(tǒng)_第4頁(yè)
C++學(xué)生管理系統(tǒng)_第5頁(yè)
已閱讀5頁(yè),還剩11頁(yè)未讀, 繼續(xù)免費(fèi)閱讀

下載本文檔

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

文檔簡(jiǎn)介

面向?qū)ο蟪绦蛟O(shè)計(jì)》課程實(shí)驗(yàn)報(bào)告學(xué)生成績(jī)管理系統(tǒng)班級(jí)計(jì)算機(jī)應(yīng)用091班姓名唐俊馳學(xué)號(hào)2009052023日期2010-12-26一、需求分析1.程序的功能:學(xué)生數(shù)據(jù)的錄入、添加、修改與刪除;成績(jī)統(tǒng)計(jì)并排名;學(xué)生數(shù)據(jù)的讀取與存儲(chǔ)等基本功能。2.輸入輸出的要求:輸入學(xué)生的成績(jī)及處理要求;輸出自己想得到的結(jié)果3.測(cè)試數(shù)據(jù)。zhang123586974wang456789658yang789896859二、詳細(xì)設(shè)計(jì)1.程序框架設(shè)計(jì):設(shè)置了添加、修改、刪除、查找、排序和對(duì)數(shù)據(jù)的讀取、保存等功能。2.程序詳細(xì)設(shè)計(jì)添加:創(chuàng)建一個(gè)新的分類,用輸入的變量初始化這個(gè)類,并用指針鏈接上一個(gè)對(duì)象。修改:先通過(guò)鏈表找到要修改的對(duì)象,在輸入要修改的值,利用類內(nèi)函數(shù)對(duì)值進(jìn)行修改。刪除:根據(jù)輸入的條件找到要?jiǎng)h除的對(duì)象,將此對(duì)象的next指針賦值給上一個(gè)對(duì)象的next值。查找:按照學(xué)號(hào)或者姓名按鏈表查找對(duì)象,找到后輸出該對(duì)象的基本信息。排序:利用比較法,按照要求的標(biāo)準(zhǔn)進(jìn)行排序。數(shù)據(jù)的讀取和保存:文件的打開(kāi)和關(guān)閉,并按照存儲(chǔ)的格式讀取。三、調(diào)試分析1.調(diào)試中遇到的問(wèn)題及對(duì)問(wèn)題的解決方法四、使用說(shuō)明及測(cè)試結(jié)果1.系統(tǒng)配置:WindowsXPSP3;VC6.02.系統(tǒng)運(yùn)行效果圖

~F:\C++YSTlJYDebii£\stu.exe口~F:\C++YSTlJYDebii£\stu.exe口atota1fcreturnhlioose<1—6ypUiaveSness-ase???Ljianstudent1snunber-sG&S,nath=57,lansuase=85,ensflisli:47,inLlians(studcnt1snuinbersl23,math:58,langfuagfe=69^ensrlisli:74,ink?ans(5tudcntJsnumbers456,niath:?S,langfuagfe:96,ens(115}i:58,ineifestudcntJsnuinbers3?48,nath:87,langfuagfe:57jens(lis}i:6?,ih/angfstudentJsnumbers78¥,math:89,language:68,englisli:59,inscores^sterm:adddeletechangelool<for五、源程序(帶注釋)1.程序代碼/*stu.cpp*/#includeviostream>#include".\ClassHead.h"usingnamespacestd;voidmain(){charc;claa;do{cout<<"\nscoresysterm:\n";coutvv"1add\n";coutvv"delete\n";coutvv"change\n";coutvv"looor\n";coutvv"paiu\n";coutvv"save\n";coutvv"read\n";coutvv"8ac\n";coutvv"choose(1-8):";cin>>c;switch(c){caseT:a.sadd();break;case'2':a.sremove();break;case'3':a.samend();break;case'4':a.ssearch();break;case'5':a.staxis();break;case'6':a.ssave();break;case'7':a.sload();break;}}while(c!='8');}*//**/#ifndef_CLASSHEAD_H#define_CLASSHEAD_H#include<iomanip>#include<fstream>#include<string>#definemax80;usingnamespacestd;classstudent{public:student*next;public:stringname;longnum;intx,y,z;intAA;voidplay(){cout<<name<<"student'snumbers"<<num<<",math:"<<x<<",language:"<<y<<",english:"<<z<<",intotal:"<<AA<<endl;};student(stringsname,longsnum,intsx,intsy,intsz){name=sname;num=snum;x=sx;y=sy;z=sz;}};classcla{public:cla(){stu=0;sload();}~cla(){student*p;p=stu;while(p){p=p->next;deletestu;stu=p;}stu=0;}voidsadd();voidsremove();voidsamend();voidssearch();voidstaxis();voidssave();voidsload();voidpxh();voidpsx();voidpyw();voidpyy();voidpAA();}}private:student*stu;};voidcla::sadd(){student*q;stringname1;longnum1;intx1,y1,z1;system("cls");cout<<"\n**addstudent**\n"<<endl;cout<<"pleaseinput:"<<endl;cout<<"name\tnumber\tmath\tlanguage\tenglish:"<<endl;cin>>name1>>num1>>x1>>y1>>z1;q=newstudent(name1,num1,x1,y1,z1);q->next=0;q->AA=x1+y1+z1;if(stu){student*t;t=stu;if(t->num==num1){cout<<"numberhasalreadybeenrecorded,pleaseinputagain"<<endl;return;}while(t->next){if(t->num==num1){cout<<"numberhasalreadybeenrecorded,pleaseinputagain"<<endl;return;}t=t->next;}t->next=q;}else{stu=q;}cout<<"down"<<endl;voidcla::sremove(){system("cls");intnum1;cout<<"\n**delete**\n";cout<<"pleaseinputthenumberyouwanttodelete:";cin>>num1;student*p1,*p2;p1=stu;while(p1){if(p1->num==num1)break;else{p2=p1;p1=p1->next;}}if(p1!=NULL){p1->play();cout<<"[Y/N]"<<endl;charc;cin>>c;if(toupper(c)!='Y')return;if(p1==stu){stu=p1->next;deletep1;}else{p2->next=p1->next;deletep1;}cout<<"findthenumberis:"<<num1<<"delete\n";}elsecout<<"there'snoinformationaboutthat!\n";}voidcla::samend(){system("cls");longnum1;cout<<"\n**changethestudentnumber**\n";

cout<<"inputthechangingnumber";cin>>num1;student*p1,*p2;p1=stu;while(p1){if(p1->num==num1)break;else{p2=p1;p1=p1->next;}}if(p1!=NULL){"namecout<<"thenumberis"<<num1<<"'information"<<endl;"namecout<<"<<p1->name<<"math"<<p1->x<<"language"<<p1->y<<"english"<<p1->z<<endl;cout<<"pleasethechanginginformation:namemathlanguageenglish"<<endl;cin>>p1->name>>p1->x>>p1->y>>p1->z;p1->AA=p1->x+p1->y+p1->z;cout<<"changesuceed"<<endl;}elsecout<<"nofound!\n";}voidcla::ssearch(){system("cls");cout<<"\n**lookfor**\n"<<endl;cout<<"pleaseinputtheway:"<<endl;cout<<"1.number"<<endl;cout<<"2.name"<<endl;cout<<"3.return"<<endl;charc;cin>>c;switch(c){case'1':{longnum1;cout<<"thenumber"<<endl;cin>>num1;student*p1,*p2;p1=stu;

while(p1){if(p1->num==num1)break;else{p2=p1;p1=p1->next;}}if(p1!=NULL){cout<<"muberis"<<num1<<"information"<<endl;cout<<"name:"<<p1->name<<"math:"<<p1->x<<"english:"<<p1->z<<endl;cout<<"down";}elsecout<<"nofoud!\n";break;}case'2':{stringname1;cout<<"thename"<<endl;cin>>name1;student*p1,*p2;p1=stu;while(p1){if(p1->name==name1)break;else{p2=p1;p1=p1->next;}}if(p1!=NULL){cout<<name1<<"information"<<endl;cout<<"number:"<<p1->num<<"math:"<<p1->x<<"english:"<<p1->z<<endl;cout<<"down...";}elselanguage:"<<p1->y<<"language:"<<p1->y<<"cout<<"nofoud!\n";language:"<<p1->y<<"language:"<<p1->y<<"break;}case'3':return;}}voidcla::pxh(){student*p1,*p2;intn;p1=stu;n=1;while(p1->next){n++;p1=p1->next;}cout<<"have"<<n<<"message..."<<endl;inti;p1=stu;for(i=1;i<n;i++){p1=stu;if(p1->num>p1->next->num){p2=p1->next;p1->next=p1->next->next;p2->next=p1;stu=p2;}p1=stu;while(p1->next->next){p2=p1;p1=p1->next;if(p1->num>p1->next->num){p2->next=p1->next;p1->next=p1->next->next;p2->next->next=p1;p1=p2->next;}}}p1=stu;do{p1->play();}}p1=p1->next;}while(p1);}voidcla::psx(){student*p1,*p2;intn;p1=stu;n=1;while(p1->next){n++;p1=p1->next;}cout<<"have"<<n<<"message..."<<endl;inti;p1=stu;for(i=1;i<n;i++){p1=stu;if(p1->x>p1->next->x){p2=p1->next;p1->next=p1->next->next;p2->next=p1;stu=p2;}p1=stu;while(p1->next->next){p2=p1;p1=p1->next;if(p1->x>p1->next->x){p2->next=p1->next;p1->next=p1->next->next;p2->next->next=p1;p1=p2->next;}}}p1=stu;do{p1->play();p1=p1->next;}while(p1);voidcla::pyw(){student*p1,*p2;intn;p1=stu;n=1;while(p1->next){n++;p1=p1->next;}cout<<"have"<<n<<"message..."<<endl;inti;p1=stu;for(i=1;i<n;i++){p1=stu;if(p1->y>p1->next->y){p2=p1->next;p1->next=p1->next->next;p2->next=p1;stu=p2;}p1=stu;while(p1->next->next){p2=p1;p1=p1->next;if(p1->y>p1->next->y){p2->next=p1->next;p1->next=p1->next->next;p2->next->next=p1;p1=p2->next;}}}p1=stu;do{p1->play();p1=p1->next;}while(p1);}voidcla::pyy(){student*p1,*p2;intn;p1=stu;n=1;while(p1->next){n++;p1=p1->next;}cout<<"have"<<n<<"message..."<<endl;inti;p1=stu;for(i=1;i<n;i++){p1=stu;if(p1->z>p1->next->z){p2=p1->next;p1->next=p1->next->next;p2->next=p1;stu=p2;}p1=stu;while(p1->next->next){p2=p1;p1=p1->next;if(p1->z>p1->next->z){p2->next=p1->next;p1->next=p1->next->next;p2->next->next=p1;p1=p2->next;}}}p1=stu;do{p1->play();p1=p1->next;}while(p1);}voidcla::pAA(){student*p1,*p2;intn;p1=stu;n=1;while(p1->next){n++;p1=p1->next;}cout<<"have"<<n<<"message..."<<endl;inti;p1=stu;for(i=1;i<n;i++){p1=stu;if(p1->AA>p1->next->AA){p2=p1->next;p1->next=p1->next->next;p2->next=p1;//頭結(jié)點(diǎn)交換stu=p2;}p1=stu;while(p1->next->next){//中間的交換p2=p1;p1=p1->next;if(p1->AA>p1->next->AA){p2->next=p1->next;p1->next=p1->next->next;p2->next->next=p1;p1=p2->next;//交換}}}p1=stu;do{p1->play();p1=p1->next;}while(p1);}voidcla::staxis(){//排序system("cls");charc;coutvv"請(qǐng)選擇以何種方式排序:"vvendl;coutvv"lnumber"vvendl;coutvv"2math"vvendl;coutvv"lanuae"vvendl;coutvv"enlish"vvendl;coutvv"total"vvendl;coutvv"6return"vvendl;coutvv"choose(l-6)"vvendl;cin>>c;switch(c){case'l':pxh();break;case'2':psx();break;case'3':pyw();break;case'4'

溫馨提示

  • 1. 本站所有資源如無(wú)特殊說(shuō)明,都需要本地電腦安裝OFFICE2007和PDF閱讀器。圖紙軟件為CAD,CAXA,PROE,UG,SolidWorks等.壓縮文件請(qǐng)下載最新的WinRAR軟件解壓。
  • 2. 本站的文檔不包含任何第三方提供的附件圖紙等,如果需要附件,請(qǐng)聯(lián)系上傳者。文件的所有權(quán)益歸上傳用戶所有。
  • 3. 本站RAR壓縮包中若帶圖紙,網(wǎng)頁(yè)內(nèi)容里面會(huì)有圖紙預(yù)覽,若沒(méi)有圖紙預(yù)覽就沒(méi)有圖紙。
  • 4. 未經(jīng)權(quán)益所有人同意不得將文件中的內(nèi)容挪作商業(yè)或盈利用途。
  • 5. 人人文庫(kù)網(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)論