小型学生管理系统的开发 实验5_第1页
小型学生管理系统的开发 实验5_第2页
小型学生管理系统的开发 实验5_第3页
小型学生管理系统的开发 实验5_第4页
小型学生管理系统的开发 实验5_第5页
已阅读5页,还剩3页未读, 继续免费阅读

下载本文档

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

文档简介

五小学系开发一实目1提高综合运用C语言进行应程序开发和设的能力。2提高和巩固以前各章所学的知。3理解链表的概念二实要1根据实验内容提出的要求,进程序系统的析和设计。2编写完整的程序代码,上机验通过。三实内利用语言,设计编写一个传统的小型的学生管理系统要求:该系统可以用于管理个班的学生息。学生人数不确定。该系统存放了几乎所的有关学生信息:如学号、姓名、性别出生地址所在系等具体数据设计者分析确定。所有学生信息的数据构及其存储构由设计者分析确定。该系统具有相关的数输入、输出查询、修改、统计、等功能。上机实验前进行系统析和设计。选用适当的算法和数结构,建立应的程序代码。7)

上机调试通证自己编写程序的结果与预料效果之间的关系。参考程序:#include"stdlib.h"

#include"stdio.h"#defineNULLstructstd{charname[20];longnum;charsex;floatscore1;floatscore2;structstd};structstdmain(){voidnew_record(void);voidlistall(void);voiddel_record(void);voidsum(void);charch;intflag=1;head=NULL;while(flag){printf("======================================\n");printf("\n'e'or'E'tonewrecord:");

printf("\n's'or'S'tothesumscoreprintf("\n'l'or'L'toallrecord:");printf("\n'd'or'D'toonerecord:");printf("\n======================================\n");ch=getchar();getchar();switch(ch){case'e':case'E':new_record();break;case'l':case'L':listall();break;case'd':case'D':del_record();break;case's':case'S':sum();break;default:flag=0;}}}intn=0;voidnew_record(void){charnumstr[20];new=(struct*)malloc(sizeof(structif(head==NULL)

head=new;else{this=head;printf("enterstuden'snum,thensystermwillreaddatebyline\n");scanf("%d",&new->num);getchar();if((new->num)<(this->num)){new->next=this;head=new;this=new;}else{if(this->next==NULL){this->next=new;this=new;}else{while((new->num)>(this->num))this=this->next;if(this->next!=NULL)

{new->next=this->next;this->next=new;this=new;}else{this->next=new;this=new;}}}}this=new;n=n+1;printf("\nentergets(this->name);printf("\nentergets(numstr);this->num=atol(numstr);printf("\nenterthis->sex=getchar();getchar();printf("\nentergets(numstr);this->score1=atof(numstr);

printf("\nentergets(numstr);this->score2=atof(numstr);if(this->next!=NULL)this->next=NULL;}voidlistall(void){inti=0;if(head==NULL){printf("\nemptythis=head;do{printf("\nrecord%d\n",++i);printf("name:%s\n",this->name);printf("num:%ld\n",this->num);printf("sex:%c\n",this->sex);printf("score1:%f\n",this->score1);printf("score2:%f\n",this->score2);printf("\nsum=%f,studentave=%f",(this->score1)+(this->score2),((this->score1)+(this->score2))/2);this=this->next;}while(this!=NULL);}

voiddel_record(void){structstdints;printf("inputdelnum:\n");scanf("%d",&s);this=head;p=head;if(s==this->num){head=this->next;free(this);}else{while(s!=this->num){p=this;this=this->next;}p->next=this->next;free(this);}}voidsum(void)

{inte=0;floatsum1=0,sum2=0;if(head==NULL)printf("\nsum1=0,sum2=0.\n");else{this=head;while(this!=NULL){e++;sum1=sum1+this

温馨提示

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

评论

0/150

提交评论