学生管理系统源代码_第1页
学生管理系统源代码_第2页
学生管理系统源代码_第3页
学生管理系统源代码_第4页
学生管理系统源代码_第5页
已阅读5页,还剩16页未读 继续免费阅读

下载本文档

版权说明:本文档由用户提供并上传,收益归属内容提供方,若内容存在侵权,请进行举报或认领

文档简介

include include include include define INIT SIZE 10 define INCRE SIZE 10 define SUBJECT NUM 3 define LEN 3 void 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 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 subject SUBJECT NUM struct STUDENT 2 int num char name 20 char sex float score SUBJECT NUM struct STUDENT stu LEN 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 sizeof STUDENT INIT SIZE record 1 num 1001 strcpy record 1 name Jason record 1 sex M record 1 score 0 85 0 record 1 score 1 90 0 record 1 score 2 95 0 record 2 num 1002 strcpy record 2 name Jerry record 2 sex M record 2 score 0 85 0 record 2 score 1 90 0 record 2 score 2 95 0 record 3 num 1003 strcpy record 3 name Jessie 3 record 3 sex F record 3 score 0 85 0 record 3 score 1 90 0 record 3 score 2 95 0 Info modify int key cout key if key 1 int targetNum cout cin targetNum modify Num targetNum cout endl display if key 2 char targetName 20 cout targetName modify Name targetName cout endl display if key 3 4 exit 0 show Start menu CMD return 0 void show Start cout endl cout endl cout endl cout endl cout endl cout endl cout Made by Jason endl cout endl void show Table cout t t cout t subject 0 t subject 1 t subject 2 cout endl void menu CMD int key while 1 5 cout 1 endl cout 2 endl cout 3 endl cout 4 endl cout 5 endl cout 6 endl cout key while 1 if key 6 int key cout endl cout key else break switch key case 1 addRecord break case 2 deleteRecord break case 3 modifyRecord break case 4 queryRecord break case 5 display 6 break case 6 quit break void addRecord if stuNum 0 cout endl stuNum else cout INIT SIZE cout endl record STUDENT realloc record INIT SIZE INCRE SIZE sizeof STUDENT cout endl cout endl cout choi if choi Y choi y cout record stuNum num cout record stuNum name cout record stuNum sex int i for i 0 i SUBJECT NUM i cout subject i record stuNum score i if choi N choi n cout endl cout endl cout stuNum endl cout endl deleteRecord void Info delete cout endl cout 1 endl cout 2 endl 8 cout 3 endl void deleteRecord int key cout endl Info delete cout key if key 1 int targetNum cout targetNum delete Num targetNum cout endl if key 2 char targetName 20 cout targetName delete Name targetName cout endl if key 3 while 1 menu CMD 9 void delete Num int tarNum int i for i 1 i stuNum i if record i num tarNum 1 2 if i stuNum cout endl show Table cout record i num t record i name t record i sex t record i score 0 record i score 1 t record i score 2 cout endl cout endl endl show Table for int i 1 i stuNum 1 i cout record i num t record i name t record i sex for int j 0 j SUBJECT NUM j cout t record i score j cout endl 10 stuNum cout stuNum cout endl 2 if i stuNum cout endl show Table cout record i num t record i name t record i sex t record i score 0 t record i score 1 t record i score 2 for int j i 1 j stuNum j record j 1 record j cout endl cout endl show Table for int i 1 i stuNum 1 i cout record i num t record i name t record i sex for int j 0 j SUBJECT NUM j cout t record i score j cout endl stuNum cout stuNum 11 cout endl stuNum cout stuNum cout endl void delete Name char tarName int i for i 1 i stuNum i if strcmp record i name tarName 0 1 2 if i stuNum cout endl show Table cout record i num t record i name t record i sex t record i score 0 record i score 1 t record i score 2 cout endl cout endl endl show Table for int i 1 i stuNum 1 i cout record i num t record i name t record i sex 12 for int j 0 j SUBJECT NUM j cout t record i score j cout endl if i stuNum cout endl show Table cout record i num t record i name t record i sex t record i score 0 t record i score 1 t record i score 2 for int j i 1 j stuNum j record j 1 record j cout endl cout endl show Table for int i 1 i stuNum 1 i cout record i num t record i name t record i sex for int j 0 j SUBJECT NUM j cout t record i score j cout endl cout endl 13 void delete Name char tarName int i for i 1 i stuNum i 1 2 if strcmp record i name tarName 0 if i stuNum cout endl show Table cout record i num t record i name t record i sex t record i score 0 t record i score 1 t record i score 2 cout endl cout endl show Table for int i 1 i stuNum 1 i cout record i num t record i name t record i sex for int j 0 j SUBJECT NUM j cout t record i score j cout endl stuNum cout stuNum cout endl 14 if i stuNum cout endl show Table cout record i num t record i name t record i sex t cout record i score 0 t record i score 1 t record i score 2 cout endl for int j i 1 j stuNum j record j 1 record j cout endl cout endl show Table for int i 1 i stuNum 1 i cout record i num t record i name t record i sex for int j 0 j SUBJECT NUM j cout t record i score j cout endl stuNum cout stuNum cout endl 15 stuNum cout stuNum cout endl void Info modify cout endl cout 1 endl cout 2 endl cout 3 endl void modifyRecord int key cout endl Info modify cout key if key 1 int targetNum cout targetNum modify Num targetNum cout endl display 16 if key 2 char targetName 20 cout 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 record i num tarNum cout endl endl cout record i num cout record i name 17 cout record i sex cout subject 0 record i score 0 cout subject 1 record i score 1 cout subject 2 record i score 2 void modify Name char tarName int i for i 1 i stuNum i if strcmp record i name tarName 0 cout endl endl cout record i num cout record i name cout record i sex cout subject 0 record i score 0 cout subject 1 record i score 1 cout subject 2 record i score 2 void Info query 18 cout endl cout 1 endl cout 2 endl cout 3 endl queryRecord void queryRecord int key cout endl Info query cout key if key 1 int targetNum cout targetNum query Num targetNum cout endl if key 2 char targetName 20 cout targetName query Name targetName cout endl if key 3 19 while 1 menu CMD void query Num int tarNum int i for i 1 i s

温馨提示

  • 1. 本站所有资源如无特殊说明,都需要本地电脑安装OFFICE2007和PDF阅读器。图纸软件为CAD,CAXA,PROE,UG,SolidWorks等.压缩文件请下载最新的WinRAR软件解压。
  • 2. 本站的文档不包含任何第三方提供的附件图纸等,如果需要附件,请联系上传者。文件的所有权益归上传用户所有。
  • 3. 本站RAR压缩包中若带图纸,网页内容里面会有图纸预览,若没有图纸预览就没有图纸。
  • 4. 未经权益所有人同意不得将文件中的内容挪作商业或盈利用途。
  • 5. 人人文库网仅提供信息存储空间,仅对用户上传内容的表现方式做保护处理,对用户上传分享的文档内容本身不做任何修改或编辑,并不能对任何下载内容负责。
  • 6. 下载文件中如有侵权或不适当内容,请与我们联系,我们立即纠正。
  • 7. 本站不保证下载资源的准确性、安全性和完整性, 同时也不承担用户因使用这些下载资源对自己和他人造成任何形式的伤害或损失。

最新文档

评论

0/150

提交评论