收藏 分销(赏)

学生管理系统源代码.doc

上传人:快乐****生活 文档编号:4054178 上传时间:2024-07-26 格式:DOC 页数:5 大小:38.04KB
下载 相关 举报
学生管理系统源代码.doc_第1页
第1页 / 共5页
学生管理系统源代码.doc_第2页
第2页 / 共5页
学生管理系统源代码.doc_第3页
第3页 / 共5页
学生管理系统源代码.doc_第4页
第4页 / 共5页
学生管理系统源代码.doc_第5页
第5页 / 共5页
亲,该文档总共5页,全部预览完了,如果喜欢就下载吧!
资源描述

1、includeincludemalloc.hdefine INIT_SIZE 10 #define INCRE_SIZE 10 define SUBJECT_NUM 3define LEN 3void show_Start();void show_Table();void addRecord();void Info_delete();void deleteRecord();void delete_Num(int);void delete_Name(char tarName);void Info_modify();void modifyRecord();void modify_Num(int);

2、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; float scoreSUBJECT_NUM; /struct STUDENT stuLEN + 1;/STUDENT record = (STUDENT*)ma

3、lloc(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(sizeof(STUDENT)INIT_SIZE);/ record1。num = 1001; strcpy(record1。name,Jason); record1。sex

4、 = M; record1.score0 = 85。0; record1。score1 = 90。0; record1.score2 = 95.0;record2.num = 1002; strcpy(record2。name,”Jerry); record2.sex = M; record2。score0 = 85。0; record2.score1 = 90。0; record2。score2 = 95.0;record3。num = 1003; strcpy(record3。name,Jessie”); record3.sex = F; record3。score0 = 85。0; re

5、cord3。score1 = 90。0; record3.score2 = 95.0;*/ Info_modify(); int key; coutkey; if(key = 1) int targetNum; cout cintargetNum; modify_Num(targetNum); coutendl; display(); if(key = 2) char targetName20; couttargetName; modify_Name(targetName); coutendl; display(); if(key = 3) exit(0); / show_Start();me

6、nu_CMD();return 0; void show_Start() /coutendl; cout” * ”endl; cout” endl; cout” ”endl; cout” endl; cout” ”endl; cout Made by Jason endl; cout * ”endl;/. void show_Table() cout”t”t” cout”tsubject0”tsubject1”t”subject2; coutendl; void menu_CMD() int key; while(1) cout”1.endl; cout2。 endl; cout3。 endl

7、; cout”4. endl; cout5。 endl; cout6. key; while(1) if(key 1)(key 6)) int key; coutendl; coutkey; 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 addRe

8、cord()if(stuNum = 0) cout INIT_SIZE) coutendl; record = (STUDENT*)realloc(record,(INIT_SIZE + INCRE_SIZE)sizeof(STUDENT); cout”!endl; coutendl; coutchoi; if(choi = Y)|(choi = y)) cout”: ”; cinrecordstuNum.num; coutrecordstuNum。name; cout”(M,F) : ”; cinrecordstuNum。sex; int i; for(i = 0;i SUBJECT_NUM

9、;i+) cout”subjecti : ; cinrecordstuNum。scorei; if(choi = N)|(choi = n) cout”endl; coutendl; coutstuNum”!”endl; coutendl;/ /deleteRecordvoid Info_delete() cout : ”endl; cout”1. ”endl; cout”2。 endl; cout”3。 ”endl;/void deleteRecord() int key; coutendl; Info_delete(); cout : ; cinkey; if(key = 1) int t

10、argetNum; cout : ”; cintargetNum; / delete_Num(targetNum); coutendl; if(key = 2) char targetName20; couttargetName; delete_Name(targetName); coutendl; 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(i = stuNum) cout”

11、: ”endl; show_Table(); coutrecordi。numt”recordi.name”trecordi.sex”t recordi。score0recordi。score1”t”recordi。score2; coutendl; coutendl”: ”endl; show_Table(); for(int i = 1;i = stuNum - 1;i+) coutrecordi.num”t”recordi。name”t”recordi.sex; for(int j = 0;j SUBJECT_NUM;j+) cout”t”recordi。scorej; coutendl;

12、 /* stuNum-; coutstuNum; coutendl; / /2。 if(i != stuNum) cout” : ”endl; show_Table(); coutrecordi.num”t”recordi。namet”recordi。sext recordi.score0”t”recordi。score1”t”recordi。score2; for(int j = i+1;j = stuNum;j+) recordj1 = recordj; / coutendl; cout : endl; show_Table(); for(int i = 1;i = stuNum-1;i+

13、) coutrecordi。num”t”recordi。name”trecordi.sex; for(int j = 0;j SUBJECT_NUM;j+) coutt”recordi.scorej; coutendl; /* stuNum; cout”stuNum coutendl; / stuNum-; cout”stuNum coutendl; /*/void delete_Name(char tarName) int i; for(i = 1;i = stuNum;i+) if(strcmp(recordi.name,tarName) = 0) / /1. /2。 / if(i = s

14、tuNum) cout” : endl; show_Table(); coutrecordi。num”t”recordi.nametrecordi。sext recordi.score0recordi。score1t”recordi。score2; coutendl; coutendl : ”endl; show_Table(); for(int i = 1;i = stuNum - 1;i+) coutrecordi.num”trecordi。name”t”recordi.sex; for(int j = 0;j SUBJECT_NUM;j+) cout”t”recordi.scorej;

15、coutendl; / if(i != stuNum) cout : endl; show_Table(); coutrecordi.num”t”recordi。nametrecordi.sex”t recordi。score0”t”recordi。score1”trecordi.score2; / for(int j = i+1;j = stuNum;j+) recordj-1 = recordj; coutendl; / cout” : endl; show_Table(); for(int i = 1;i = stuNum1;i+) coutrecordi。num”t”recordi.n

16、amet”recordi。sex; for(int j = 0;j SUBJECT_NUM;j+) couttrecordi。scorej; coutendl; coutendl; void delete_Name(char tarName) int i; for(i = 1;i = stuNum;i+) / /1. /2. / if(strcmp(recordi.name,tarName) = 0) if(i = stuNum) cout : ”endl; show_Table(); coutrecordi。num”trecordi.name”t”recordi。sex”t recordi。

17、score0”t”recordi.score1”trecordi。score2; coutendl; cout” : endl; show_Table(); for(int i = 1;i = stuNum-1;i+) coutrecordi.num”trecordi。name”t”recordi.sex; for(int j = 0;j SUBJECT_NUM;j+) cout”t”recordi。scorej; coutendl; / stuNum-; cout”stuNum”; coutendl; / / if(i != stuNum) cout”endl; show_Table();

18、coutrecordi.num”t”recordi。name”t”recordi.sext; coutrecordi。score0”trecordi。score1t”recordi.score2; coutendl; for(int j = i+1;j = stuNum;j+) recordj-1 = recordj; /。 coutendl; cout : ”endl; show_Table(); for(int i = 1;i = stuNum1;i+) coutrecordi。num”t”recordi。name”trecordi。sex; for(int j = 0;j SUBJECT

19、_NUM;j+) cout”t”recordi.scorej; coutendl; / stuNum-; coutstuNum coutendl; / stuNum; cout”stuNum”; coutendl; /*/void Info_modify() cout : ”endl; cout”1. ”endl; cout2。 endl; cout3. ”endl; void modifyRecord() int key; coutendl; Info_modify(); coutkey;/ if(key = 1) int targetNum; couttargetNum; modify_N

20、um(targetNum); coutendl; /display(); / if(key = 2) char targetName20; cout : ; cintargetName; modify_Name(targetName); coutendl; /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) coutrecordi.num; cout : ”; cinrecordi。na

21、me; coutrecordi。sex; cout”subject0recordi.score0; cout”subject1recordi。score1; cout”subject2 ”; cinrecordi。score2; void modify_Name(char tarName) int i; for(i = 1;i = stuNum;i+) if(strcmp(recordi.name,tarName) = 0) coutendl: endl; coutrecordi.name; cout : ”; cinrecordi.sex; cout”subject0 : ”; cinrec

22、ordi。score0; cout”subject1” : ”; cinrecordi.score1; cout”recordi。score2; void Info_query() cout : endl; cout”1。 ”endl; cout2。 endl; cout”3。 ”endl; /queryRecord void queryRecord() int key; coutendl; Info_query(); cout”; cinkey; if(key = 1) int targetNum; couttargetNum; query_Num(targetNum); coutendl;

23、 if(key = 2) char targetName20; couttargetName; query_Name(targetName); coutendl; /. 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(); / coutrecordi。num”trecordi。name”trecordi。sex; cout”t”recordi。score0

24、”t”recordi.score1”t”recordi。score2; coutendl; /void query_Name(char tarName) int i; for(i = 1;i = stuNum;i+) if(strcmp(recordi。name,tarName) = 0) cout”: ”endl; show_Table(); coutrecordi.num”t”recordi。nametrecordi.sex; cout”t”recordi。score0”t”recordi.score1”t”recordi。score2; coutendl; /void display() show_Table(); int i,j; for(i = 1;i = stuNum;i+) /cout学号”t”姓名”t”性别”; coutrecordi.numt”recordi.nametrecordi。sex; for(j = 0;j SUBJECT_NUM;j+) couttrecordi。scorej; coutendl; coutendl; /void quit() char choi; coutchoi; if(choi = Y)|(choi = y) cout”endl; exit(0); / else coutendl; menu_CMD();

展开阅读全文
部分上传会员的收益排行 01、路***(¥15400+),02、曲****(¥15300+),
03、wei****016(¥13200+),04、大***流(¥12600+),
05、Fis****915(¥4200+),06、h****i(¥4100+),
07、Q**(¥3400+),08、自******点(¥2400+),
09、h*****x(¥1400+),10、c****e(¥1100+),
11、be*****ha(¥800+),12、13********8(¥800+)。
相似文档                                   自信AI助手自信AI助手
百度文库年卡

猜你喜欢                                   自信AI导航自信AI导航
搜索标签

当前位置:首页 > 教育专区 > 其他

移动网页_全站_页脚广告1

关于我们      便捷服务       自信AI       AI导航        获赠5币

©2010-2024 宁波自信网络信息技术有限公司  版权所有

客服电话:4008-655-100  投诉/维权电话:4009-655-100

gongan.png浙公网安备33021202000488号   

icp.png浙ICP备2021020529号-1  |  浙B2-20240490  

关注我们 :gzh.png    weibo.png    LOFTER.png 

客服