學(xué)生管理系統(tǒng)源代碼_第1頁(yè)
學(xué)生管理系統(tǒng)源代碼_第2頁(yè)
學(xué)生管理系統(tǒng)源代碼_第3頁(yè)
學(xué)生管理系統(tǒng)源代碼_第4頁(yè)
學(xué)生管理系統(tǒng)源代碼_第5頁(yè)
已閱讀5頁(yè),還剩16頁(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)介

1、#include<iostream>#include<stdlib.h>#include<string.h>#include<malloc.h>#define INIT_SIZE 10 #define INCRE_SIZE 10 #define SUBJECT_NUM 3#define LEN 3void show_Start();void show_Table();void addRecord();void Info_delete();void deleteRecord();void delete_Num(int);void delete_Na

2、me(char tarName);void Info_modify();void modifyRecord();void modify_Num(int);void modify_Name(char);void Info_query();void queryRecord();void query_Num(int);void query_Name(char);void display();void quit();void menu_CMD();char *subjectSUBJECT_NUM = struct STUDENT int num; char name20; char sex; floa

3、t scoreSUBJECT_NUM; /struct STUDENT stuLEN + 1;/STUDENT *record = (STUDENT*)malloc(sizeof(STUDENT)*INIT_SIZE);int static stuNum = 0; /STUDENT *record = (STUDENT*)malloc(sizeof(STUDENT)*INIT_SIZE);int main() /record = (STUDENT*)malloc(sizeof(STUDENT)*INIT_SIZE); /STUDENT *record = (STUDENT*)malloc(si

4、zeof(STUDENT)*INIT_SIZE);/* record1.num = 1001; strcpy(,"Jason"); record1.sex = 'M' record1.score0 = 85.0; record1.score1 = 90.0; record1.score2 = 95.0;record2.num = 1002; strcpy(,"Jerry"); record2.sex = 'M' record2.score0 = 85.0; record2.s

5、core1 = 90.0; record2.score2 = 95.0;record3.num = 1003; strcpy(,"Jessie"); record3.sex = 'F' record3.score0 = 85.0; record3.score1 = 90.0; record3.score2 = 95.0;*/* Info_modify(); int key; cout< cin>>key; if(key = 1) int targetNum; cout cin>>targetNum; mo

6、dify_Num(targetNum); cout<<endl; display(); if(key = 2) char targetName20; cout< cin>>targetName; modify_Name(targetName); cout<<endl; display(); if(key = 3) exit(0); */ show_Start();menu_CMD();return 0; void show_Start() /cout<<endl; cout<<" * "<<end

7、l; cout<<" "<<endl; cout<<" "<<endl; cout<<" "<<endl; cout<<" "<<endl; cout<<" Made by Jason "<<endl; cout<<" * "<<endl;/. void show_Table() cout<<" <<

8、"t"<<" "<<"t"<<" cout<<"t"<<subject0<<"t"<<subject1<<"t"<<subject2; cout<<endl; void menu_CMD() int key; while(1) cout<<"1. <<endl; cout<<"2. <&

9、lt;endl; cout<<"3. <<endl; cout<<"4. <<endl; cout<<"5. <<endl; cout<<"6. <<endl; cout<<" cin>>key; while(1) if(key < 1)|(key > 6) int key; cout<< "<<endl; cout<< (1 - 5) : " cin>

10、>key; else break; switch(key) case 1: addRecord(); break; case 2: deleteRecord(); break; case 3: modifyRecord(); break; case 4: queryRecord(); break; case 5: display(); break; case 6: quit(); break; /void addRecord()if(stuNum = 0) cout<< <<endl; stuNum+; else cout<<" <&l

11、t;endl; stuNum+; / if(stuNum > INIT_SIZE) cout<< "<<endl; record = (STUDENT*)realloc(record,(INIT_SIZE + INCRE_SIZE)*sizeof(STUDENT); cout<<" !"<<endl; cout<<" <<endl; cout<<" (Y/N) : " char choi; cin>>choi; if(choi = &

12、#39;Y')|(choi = 'y') cout<<" : " cin>>recordstuNum.num; cout<<" : " cin>>recordstuN; cout<<"(M , F) : " cin>>recordstuNum.sex; int i; for(i = 0;i < SUBJECT_NUM;i+) cout<<" "<<subjecti<<

13、; : " cin>>recordstuNum.scorei; if(choi = 'N')|(choi = 'n') cout<<" <<endl; cout<<endl; cout<< <<stuNum<<" !"<<endl; cout<<endl;/ /deleteRecord void Info_delete() cout<<" : "<<endl; cout&l

14、t;<"1. "<<endl; cout<<"2. <<endl; cout<<"3. "<<endl;/ void deleteRecord() int key; cout<<endl; Info_delete(); cout<<" : " cin>>key; if(key = 1) int targetNum; cout<<" : " cin>>targetNum; / del

15、ete_Num(targetNum); cout<<endl; if(key = 2) char targetName20; cout<<" : " cin>>targetName; delete_Name(targetName); cout<<endl; if(key = 3) while(1) menu_CMD(); / void delete_Num(int tarNum) int i; for(i = 1;i <= stuNum;i+) if(recordi.num = tarNum) / /1. /2. if(

16、i = stuNum) cout<<" : "<<endl; show_Table(); cout<<recordi.num<<"t"<<<<"t"<<recordi.sex<<"t" <<recordi.score0<<recordi.score1<<"t"<<recordi.score2; cout<<endl;

17、cout<<endl<<" : "<<endl; show_Table(); for(int i = 1;i <= stuNum - 1;i+) cout<<recordi.num<<"t"<<<<"t"<<recordi.sex; for(int j = 0;j < SUBJECT_NUM;j+) cout<<"t"<<recordi.scorej; cout

18、<<endl; /* stuNum-; cout<<" <<stuNum<<" cout<<endl; */ /2. if(i != stuNum) cout<<" : "<<endl; show_Table(); cout<<recordi.num<<"t"<<<<"t"<<recordi.sex<<"t" <

19、<recordi.score0<<"t"<<recordi.score1<<"t"<<recordi.score2; for(int j = i+1;j <= stuNum;j+) recordj-1 = recordj; / cout<<endl; cout<<" : "<<endl; show_Table(); for(int i = 1;i <= stuNum-1;i+) cout<<recordi.num<&

20、lt;"t"<<<<"t"<<recordi.sex; for(int j = 0;j < SUBJECT_NUM;j+) cout<<"t"<<recordi.scorej; cout<<endl; /* stuNum-; cout<<" "<<stuNum<<" cout<<endl; */ stuNum-; cout<<" &qu

21、ot;<<stuNum<< cout<<endl; /*/void delete_Name(char tarName) int i; for(i = 1;i <= stuNum;i+) if(strcmp(,tarName) = 0) / /1. /2. / if(i = stuNum) cout<<" : "<<endl; show_Table(); cout<<recordi.num<<"t"<<<

22、;<"t"<<recordi.sex<<"t" <<recordi.score0<<recordi.score1<<"t"<<recordi.score2; cout<<endl; cout<<endl<<" : "<<endl; show_Table(); for(int i = 1;i <= stuNum - 1;i+) cout<<recordi.num<<

23、;"t"<<<<"t"<<recordi.sex; for(int j = 0;j < SUBJECT_NUM;j+) cout<<"t"<<recordi.scorej; cout<<endl; / if(i != stuNum) cout<<" : "<<endl; show_Table(); cout<<recordi.num<<"t"<

24、;<<<"t"<<recordi.sex<<"t" <<recordi.score0<<"t"<<recordi.score1<<"t"<<recordi.score2; / for(int j = i+1;j <= stuNum;j+) recordj-1 = recordj; cout<<endl; / cout<<" : "<&l

25、t;endl; show_Table(); for(int i = 1;i <= stuNum-1;i+) cout<<recordi.num<<"t"<<<<"t"<<recordi.sex; for(int j = 0;j < SUBJECT_NUM;j+) cout<<"t"<<recordi.scorej; cout<<endl; cout<<endl; void delete_Nam

26、e(char tarName) int i; for(i = 1;i <= stuNum;i+) / /1. /2. / if(strcmp(,tarName) = 0) if(i = stuNum) cout<<" : "<<endl; show_Table(); cout<<recordi.num<<"t"<<<<"t"<<recordi.sex<<"t" <

27、;<recordi.score0<<"t"<<recordi.score1<<"t"<<recordi.score2; cout<<endl; cout<<" : "<<endl; show_Table(); for(int i = 1;i <= stuNum-1;i+) cout<<recordi.num<<"t"<<<<"t"

28、<<recordi.sex; for(int j = 0;j < SUBJECT_NUM;j+) cout<<"t"<<recordi.scorej; cout<<endl; /* stuNum-; cout<<" "<<stuNum<<" " cout<<endl; */ / if(i != stuNum) cout<<" "<<endl; show_Table(); cout<&l

29、t;recordi.num<<"t"<<<<"t"<<recordi.sex<<"t" cout<<recordi.score0<<"t"<<recordi.score1<<"t"<<recordi.score2; cout<<endl; for(int j = i+1;j <= stuNum;j+) recordj-1 = recor

30、dj; /. cout<<endl; cout<<" : "<<endl; show_Table(); for(int i = 1;i <= stuNum-1;i+) cout<<recordi.num<<"t"<<<<"t"<<recordi.sex; for(int j = 0;j < SUBJECT_NUM;j+) cout<<"t"<<recordi.s

31、corej; cout<<endl; /* stuNum-; cout<<" "<<stuNum<< cout<<endl; */ stuNum-; cout<<" <<stuNum<< " cout<<endl; /*/void Info_modify() cout<<" : "<<endl; cout<<"1. "<<endl; cout<<&q

32、uot;2. "<<endl; cout<<"3. "<<endl; void modifyRecord() int key; cout<<endl; Info_modify(); cout<<" : " cin>>key;/ if(key = 1) int targetNum; cout<< : " cin>>targetNum; modify_Num(targetNum); cout<<endl; /display(); /

33、 if(key = 2) char targetName20; cout<< : " cin>>targetName; modify_Name(targetName); cout<<endl; /display(); if(key = 3) while(1) menu_CMD(); /void modify_Num(int tarNum) int i; for(i = 1;i <= stuNum;i+) if(recordi.num = tarNum) cout<<endl<<" "<<

34、endl; cout<<" : " cin>>recordi.num; cout<<" : " cin>>; cout<<" cin>>recordi.sex; cout<<" "<<subject0<<" " cin>>recordi.score0; cout<<" "<<subject1<<"

35、: " cin>>recordi.score1; cout<<" "<<subject2<< " cin>>recordi.score2; void modify_Name(char tarName) int i; for(i = 1;i <= stuNum;i+) if(strcmp(,tarName) = 0) cout<<endl<<" : "<<endl; cout<<" : &q

36、uot; cin>>recordi.num; cout<<" : " cin>>; cout<<" : " cin>>recordi.sex; cout<<" "<<subject0<<" : " cin>>recordi.score0; cout<<" "<<subject1<<" : " cin>&g

37、t;recordi.score1; cout<<" "<<subject2<<" : " cin>>recordi.score2; void Info_query() cout<<" : "<<endl; cout<<"1. "<<endl; cout<<"2. "<<endl; cout<<"3. "<<endl; /queryRe

38、cord void queryRecord() int key; cout<<endl; Info_query(); cout<<" " cin>>key; if(key = 1) int targetNum; cout<<" : " cin>>targetNum; query_Num(targetNum); cout<<endl; if(key = 2) char targetName20; cout<<" : " cin>>targetName; query_Name(targetName); cout<<endl; / . if(key = 3) while(1) menu_CMD(); void query_Num(int tarNum) int i; for(i = 1;i <= stuNum;i+) if(recordi.num = tarNum) / cout<<" : "<<endl; / show_Table(); / cout<<recordi.num&l

溫馨提示

  • 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)論