学生成绩管理系统(C语言)汇编

上传人:枫** 文档编号:511119080 上传时间:2023-12-31 格式:DOCX 页数:21 大小:532.48KB
返回 下载 相关 举报
学生成绩管理系统(C语言)汇编_第1页
第1页 / 共21页
学生成绩管理系统(C语言)汇编_第2页
第2页 / 共21页
学生成绩管理系统(C语言)汇编_第3页
第3页 / 共21页
学生成绩管理系统(C语言)汇编_第4页
第4页 / 共21页
学生成绩管理系统(C语言)汇编_第5页
第5页 / 共21页
点击查看更多>>
资源描述

《学生成绩管理系统(C语言)汇编》由会员分享,可在线阅读,更多相关《学生成绩管理系统(C语言)汇编(21页珍藏版)》请在金锄头文库上搜索。

1、学习 - 好资料C 语言程序设计学生成绩管理系统学院自动化学院专业班级学号姓名联系方式2013 年 11月 11 日更多精品文档学习 - 好资料程序代码:#include#include#include#pragma comment(lib,winmm.lib)#include void add(char filename);struct STUDENT * rdfile(char filename,int *num);void display(char filename);int alter(char filename);int delet(char filename);void rank(

2、char filename);void decorete(int clr,char color,char width,char heighth,char title,char edge,int curn,int curk); int char2int(char cha);float avecal(struct STUDENT *p);void fail(char filename);int removefile(char filename); / 删除则返回 1,未删除返回 0; int sound(int sflag,int i,int s);struct STUDENTchar name1

3、0;char course510;float score5;float ave;int xuhao;int sw=-1;void main()FILE *fp;int num=0;char filename20,cz;sound(0,0,sw);while(1)file:decorete(0,0e,67,27, 学生成绩管理 欢迎您,+,0,0); decorete(1,15,67,27,输入数据文件名 (默认 :.bin), ,0,0);decorete(1,15,67,27, ,1,24);printf();fflush(stdin);gets(filename);printf(n);if

4、(strcmp(filename,exit)=0)sound(1,1,sw);exit(0);更多精品文档学习 - 好资料if(strcmp(filename,list)=0)sound(4,0,sw);system(dir /o:d*.bin);fflush(stdin);getchar();gotofile;strcat(filename,.bin);if(fp=fopen(filename,r)=NULL)sound(2,0,sw);decorete(1,15,67,27,文件不存在,是否 创建该文件 ?, ,0,24); printf(-);fflush(stdin);cz=getch

5、ar();printf(n);if(cz=Y|cz=y)fp=fopen(filename,w);elsegoto file;fclose(fp);sound(4,0,sw);cz= ;while(1)display(filename);decorete(1,07,105,35, 选择操作 :, ,0,0);decorete(1,07,105,35,A. 不及格 学生名单 B.排序C.修改D.删除 E.增加S.声音 F.退出本文件 R.删除文件 N.退出程序 , ,0,50); fflush(stdin);cz=getchar();switch(cz)case A:sound(4,0,sw);

6、fail(filename);break;case a:sound(4,0,sw);fail(filename);break;case B:rank(filename);sound(4,0,sw);break;case b:rank(filename);sound(4,0,sw);break;case C:alter(filename);sound(4,0,sw);break;case c:alter(filename);sound(4,0,sw);break;case D:delet(filename);sound(5,0,sw);break;case d:delet(filename);s

7、ound(5,0,sw);break;case E:add(filename);sound(4,0,sw);break;case e:add(filename);sound(4,0,sw);break;case F:sound(5,0,sw);goto file;case f:sound(5,0,sw);goto file;case r:if(removefile(filename)goto file;break;case R:if(removefile(filename)goto file;break;case N:sound(1,1,sw);exit(0);更多精品文档学习 - 好资料ca

8、se n:sound(1,1,sw);exit(0);case S:sw=sw;sound(4,0,sw);break;case s:sw=sw;sound(4,0,sw);break;void add(char filename)FILE *fp;int i, *rs,rsh;float temps;struct STUDENT *p;rs=↱p=rdfile(filename,rs);prsh=(struct STUDENT *)malloc(sizeof(struct STUDENT);prsh-xuhao=rsh+1;printf(tt请输入名字: );name: fflush

9、(stdin);gets(prsh-name);if(strlen(prsh-name)=0)printf(ttt);goto name;strcpy(prsh-course0,高等数学 );strcpy(prsh-course1,物理 );strcpy(prsh-course2,外语 );strcpy(prsh-course3,C语言);strcpy(prsh-course4,德育 );printf(ntttt输入各成 绩:n);for(i=0;icoursei);score: fflush(stdin);scanf(%f,&temps);if(temps=0&tempsscorei=tem

10、ps;elsesound(2,0,sw);printf(ttt分数范围(0-150),重新 输入: );goto score;prsh-ave=avecal(prsh);if(fp=fopen(filename,a)=NULL)更多精品文档学习 - 好资料sound(3,0,sw);printf(无法打开相关文件! );exit(0);fprintf(fp,%d. 姓 名 :%8s %8s :%5.2f%5s :%5.2f%5s :%5.2f %6s :%5.2f%5s :%5.2f平 均分 :%5.2fn,prsh-xuhao,prsh-name,prsh-course0,prsh-scor

11、e0,prsh-course1,prsh-score1,prsh-course2,prsh-score2,prsh-course3,prsh-score3,prsh-course4,prsh-score4,prsh-ave);fclose(fp);struct STUDENT * rdfile(char filename,int *num)FILE *fp;struct STUDENT *p;int xh=0;char ch;p=(struct STUDENT *)malloc(sizeof(struct STUDENT*);if(fp=fopen(filename,r)=NULL)sound(3,0,sw);printf(无法打开相关文件! n);system(pause);exit(0);while(ch=fgetc(fp)!=EOF)fseek(fp,-1L,1);pxh=(struct STUDENT *)malloc(sizeof(struct STUDENT);pxh-xuhao=xh+1;fscanf(fp,%d. 姓名:%8s%8s:%f%5s:%f%5s:%f%6s:%f%5s:%f平均分 :%fn,&pxh-x

展开阅读全文
相关资源
正为您匹配相似的精品文档
相关搜索

最新文档


当前位置:首页 > 办公文档 > 演讲稿/致辞

电脑版 |金锄头文库版权所有
经营许可证:蜀ICP备13022795号 | 川公网安备 51140202000112号