最新VC--综合实验-图书馆管理系统.doc
《最新VC--综合实验-图书馆管理系统.doc》由会员分享,可在线阅读,更多相关《最新VC--综合实验-图书馆管理系统.doc(80页珍藏版)》请在淘文阁 - 分享文档赚钱的网站上搜索。
1、Four short words sum up what has lifted most successful individuals above the crowd: a little bit more.-author-dateVC-综合实验-图书馆管理系统VC+综合实验 图书馆管理系统VC+综合实验 图书馆管理系统.txt都是一个山的狐狸,你跟我讲什么聊斋,站在离你最近的地方,眺望你对别人的微笑,即使心是百般的疼痛只为把你的一举一动尽收眼底刺眼的白色,让我明白什么是纯粹的伤害。#include#include#include#define LENGTH 20#define SUBJECT
2、10char subcallSUBJECTLENGTH;int num_of_stu=0;int num_of_sub=0;struct datachar nameLENGTH;char numLENGTH;float scoreSUBJECT;float sum;float aver;struct data *next;void Menu(void);struct data *Append(struct data*);void Check(struct data*);void Modify(struct data*);void List(struct data*);void Search(s
3、truct data*);struct data *Delete(struct data*);struct data *Sort1(struct data*,int (*g)(float,float);void Sort2(struct data*,int (*g)(float,float);int descend(float,float);int ascend(float,float);void main()Menu();void Menu(void)char *choice9=1.Append record,2.Check record,3.Modify record,4.List rec
4、ord,5.Search record,6.Delete record,7.Sort score in descending order,8.Sort score in ascending order,0.exit;struct data *head=NULL;char reply,c;int n=0,k,i;for(i=0;ik)?n:k;while(1)system(cls);printf(ttWelcome to the Students Score Management Systemn); printf(ttt-n); for(i=0;i0;k+) putchar( ); printf
5、(|n);printf(ttt-n);while(1)printf(Please input your choice:); reply=getchar(); if(reply=n)continue;elsec=getchar();if(reply=0&reply1&head=NULL)printf(There is no data stored!n);else switch(reply) case1:head=Append(head);break; case2:Check(head);break; case3:Modify(head);break; case4:List(head);break
6、; case5:Search(head);break; case6:head=Delete(head);break; case7:Sort2(head,descend);break; case8:Sort2(head,ascend);break; default:while(1) printf(Do you really want to exit(Y/N or y/n)?); reply=getchar();if(reply=n)continue;elsec=getchar();if(reply=Y|reply=N|reply=y|reply=n)&c=n)break;else if(c!=n
7、)while(c=getchar()!=n);if(reply=Y|reply=y)free(head);return;while(1) printf(Press ENTER to continue:);scanf(%c,&reply);if(reply=n)break;elsewhile(c=getchar()!=n);struct data *Append(struct data *head)struct data *p;char reply,c;int i;system(cls);if(head=NULL)p=head=(struct data*)malloc(sizeof(struct
8、 data);printf(How many subjects do you want to record(n=%d)?,SUBJECT);scanf(%d%*c,&num_of_sub);for(i=0;inext!=NULL;p=p-next);p-next=(struct data*)malloc(sizeof(struct data);p=p-next; loop:printf(Please input the students name:);scanf(%s%*c,p-name);printf(Please input the students number:);scanf(%s%*
9、c,p-num);p-sum=0;for(i=0;iscorei);p-sum+=p-scorei;p-aver=p-sum/num_of_sub;num_of_stu+;while(1) printf(Do you want to go on appending(Y/N or y/n)?); reply=getchar();if(reply=n)continue;elsec=getchar();if(reply=Y|reply=N|reply=y|reply=n)&c=n)break;else if(c!=n)while(c=getchar()!=n);if(reply=Y|reply=y)
10、p-next=(struct data*)malloc(sizeof(struct data);p=p-next;goto loop;elsep-next=NULL;return head;void Check(struct data *head)struct data *p,*q;struct data *t=(struct data*)malloc(num_of_stu/2*sizeof(struct data*);int minlim,maxlim,n=0,i;system(cls);for(p=head;p!=NULL;p=p-next)for(i=0;iname,(*(t+i)-na
11、me)=0)break;if(inext;q!=NULL;q=q-next)if(strcmp(p-name,q-name)=0)printf(Name %s has been inputed repeatedly!n,p-name);*(t+n)=p;n+;break;printf(Altogether %d name has been repeatedly inputed.n,n);n=0;for(p=head;p!=NULL;p=p-next)for(i=0;inum,(*(t+i)-num)=0)break;if(inext;q!=NULL;q=q-next)if(strcmp(p-n
12、um,q-num)=0)printf(Students number %s has been inputed repeatedly!n,p-num);*(t+n)=p;n+;break;printf(Altogether %d number has been repeatedly inputed.n,n);free(t);n=0;printf(Now check datan);printf(Please input the minimum limit:);scanf(%d%*c,&minlim);printf(Please input the maximum limit:);scanf(%d%
13、*c,&maxlim);if(maxlimnext)for(i=0;iscoreiscoreimaxlim)if(!n)printf(These data has been wrongly inputed:n);printf(%ss %s score.n,p-name,subcalli);n+;printf(Altogether %d wrong data.n,n);void Modify(struct data *head)struct data *p;char modnameLENGTH,modscoreLENGTH;char reply,c;int i;system(cls);do pr
14、intf(Please input the name of the student whose data you want to modify:); scanf(%s%*c,modname); for(p=head;p!=NULL&strcmp(p-name,modname)!=0;p=p-next); if(p=NULL) printf(The student doesnt exist!n); elseprintf(Successfully found!n);while(1) printf(Do you want to modify the students number(Y/N or y/
15、n)?); reply=getchar(); if(reply=n) continue; else c=getchar(); if(reply=Y|reply=N|reply=y|reply=n)&c=n) break; else if(c!=n) while(c=getchar()!=n);if(reply=Y|reply=y)printf(Please input the students new number:);scanf(%s%*c,p-num);while(1) printf(Do you want to modify the students score(Y/N or y/n)?
- 配套讲稿:
如PPT文件的首页显示word图标,表示该PPT已包含配套word讲稿。双击word图标可打开word文档。
- 特殊限制:
部分文档作品中含有的国旗、国徽等图片,仅作为作品整体效果示例展示,禁止商用。设计者仅对作品中独创性部分享有著作权。
- 关 键 词:
- 最新 VC 综合 实验 图书馆 管理 系统
限制150内