




已阅读5页,还剩11页未读, 继续免费阅读
版权说明:本文档由用户提供并上传,收益归属内容提供方,若内容存在侵权,请进行举报或认领
文档简介
课程设计报告课程设计题目:成绩管理 学生姓名: xx 专 业:xxx班 级:xxx指导教师: xx 20xx年x月x日东华理工大学课程设计评分表学生姓名: xx 班级: xxxx 学号:xxxxx课程设计题目:成绩管理项目内容满分实 评选题能结合所学课程知识、有一定的能力训练。符合选题要求(5人一题)10工作量适中,难易度合理10能力水平能熟练应用所学知识,有一定查阅文献及运用文献资料能力10理论依据充分,数据准确,公式推导正确10能应用计算机软件进行编程、资料搜集录入、加工、排版、制图等10能体现创造性思维,或有独特见解10成果质量总体设计正确、合理,各项技术指标符合要求。10说明书综述简练完整,概念清楚、立论正确、技术用语准确、结论严谨合理;分析处理科学、条理分明、语言流畅、结构严谨、版面清晰10设计说明书栏目齐全、合理,符号统一、编号齐全。格式、绘图、表格、插图等规范准确,符合国家标准10有一定篇幅,字符数不少于500010总 分100指导教师评语: 指导教师签名: 年 月 日实验题目:成绩管理1、 实验目的1.掌握线性表的创建及基本操作;2.掌握基本排序3.复习文件相关的操作(1)用顺序结构表示成绩单,完成任务(1)(6),成绩为及格;(2)用链表表示成绩单,完成任务(1)(6),且软件容错能力强,成绩为中等。2、 实验内容 问题描述:给出n个学生的考试成绩表,成绩表包括学生的学号、姓名、考试成绩(高等数学、英语、物理),设计一个简单的成绩管理程序。基本要求:(1)建立成绩表,能够插入、删除、修改学生的成绩记录;(2)按任一单科成绩排序;(3) 计算每名学生的平均成绩;(4) 统计任一单科成绩不及格的学生人数, 输出不及格人数及不及格的学生名单(5) 根据平均成绩将成绩表按由高到低的次序排列,统计每名学生在考试中获得的名次,分数相同的为同一名次,按名次输出成绩表。(6) 成绩表保存在文件中, 可以从文件读取数据。3、 实验设计1. 定义单链表存储结构 typedef struct student char id12; char name20; int c1; int c2; int c3; student *next;student;2. 建立成绩表及其涉及的相关函数student *appendnode(student *head);/增加void dislink(student *head);/显示student *insertnode(student *head);/插入student *delnode(student *head);/删除student *alter(student *head);/修改 student *start(student *head);/初始赋值student *com(student *head);/排序student *readdata(student *head);/读取数据void savedata(student *head);/存储数据void mathcount(student *head);/统计高数不及格人数3. 具体程序代码#include#include#includetypedef struct student char id12; char name20; int c1; int c2; int c3; student *next;student;student *appendnode(student *head);/增加void dislink(student *head);/显示student *insertnode(student *head);/插入student *delnode(student *head);/删除student *alter(student *head);/修改 student *start(student *head);/初始赋值student *com(student *head);/冒泡排序student *readdata(student *head);/读取数据void savedata(student *head);/存储数据void mathcount(student *head);/统计高数不及格人数int main() int a; student *head=null; int k=1; head=readdata(head);/先读文件 if (head=null)/如果不存在的话创建数据 head=start(head); while(k) dislink(head);/数据多的话不必每次都显示 printf(1 增加数据n); printf(2 插入数据n); printf(3 修改数据n); printf(4 删除排序n); printf(5 排序数据n); printf(6 显示数据n); printf(7 统计高数不及格人数n); printf(8 退出n); printf(选择:); scanf( %d,&a); switch(a) case 1: head=appendnode(head); break; case 2: head=insertnode(head); break; case 3: head=alter(head); break; case 4: head=delnode(head); break; case 5: head=com(head); break; case 6: break; case 7: mathcount(head); break; case 8: k=0; break; default: printf(请输入有效选择!n); savedata(head); return 0;student *start(student *head) student *p=null; student *pr=head; p=(student *)malloc(sizeof(student); head=p; pr=p; strcpy(pr-id,08002813); strcpy(pr-name,bener); pr-c1=98; pr-c2=99; pr-c3=95; p=(student *)malloc(sizeof(student); pr-next=p; pr=pr-next; strcpy(pr-id,08001303); strcpy(pr-name,大雄); pr-c1=67; pr-c2=73; pr-c3=59; p=(student *)malloc(sizeof(student); pr-next=p; pr=pr-next; strcpy(pr-id,09001823); strcpy(pr-name,胖虎); pr-c1=64; pr-c2=69; pr-c3=75; p=(student *)malloc(sizeof(student); pr-next=p; pr=pr-next; strcpy(pr-id,08002818); strcpy(pr-name,静香); pr-c1=95; pr-c2=91; pr-c3=89;p=(student *)malloc(sizeof(student); pr-next=p; pr=pr-next; strcpy(pr-id,09004813); strcpy(pr-name,康夫); pr-c1=46; pr-c2=75; pr-c3=88;pr-next=null; return head;void dislink(student *head) student *p=head; int j=1; printf(序号 学号 名字 高数 英语 物理 平均分n); while(p!=null)printf(%3d%10s%10s%6d%6d%6d%8.2fn,j,p-id,p-name,p-c1,p-c2,p-c3,(p-c1+p-c2+p-c3)/3.0); p=p-next; j+; student *appendnode(student *head) student *p=null; student *pr=head; char id12; char name20; int c1; int c2; int c3; p=(student *)malloc(sizeof(student); if(p=null) printf(no enough memory to alloc); exit(0); else if(head=null) head=p; else while(pr-next!=null) pr=pr-next; pr-next=p; pr=p; printf(请输入学号:); scanf( %s,&id); printf(请输入名字:); scanf( %s,&name); printf(请依次输入高数,英语,物理成绩:); scanf( %d%d%d,&c1,&c2,&c3); strcpy(pr-id,id); strcpy(pr-name,name); pr-c1=c1; pr-c2=c2; pr-c3=c3; pr-next=null; return head;void deletememory(student *head) student *p=head,*pr=null; while(p!=null) pr=p; p=p-next; student *delnode(student *head) student *p=head,*pr=head; int i,j; printf(删除第几个数据?); scanf( %d,&i); for(j=1;jnext; pr-next=p-next; free(p); return head;student *insertnode(student *head) student *pr=head,*p=head,*temp=null; int i,j; char id12; char name20; int c1; int c2; int c3; p=(student *)malloc(sizeof(student); printf(请输入学号:); scanf( %s,&id); printf(请输入名字:); scanf( %s,&name); printf(请依次输入高数,英语,物理成绩:); scanf( %d%d%d,&c1,&c2,&c3); 3; p-next=null; strcpy(p-id,id); strcpy(p-name,name); p-c1=c1; p-c2=c2; p-c3=c3; printf(插入到第几个?); scanf( %d,&i); for(j=1;jnext; if(pr=head) p-next=head; head=p; else pr=temp; p-next=pr-next; pr-next=p; return head;student *com(student *head) student *pr=head,*p=head,temp1; int i=1,j,k; while(p-next!=null) p=p-next; i+; p=head; for(j=1;jnext; for(k=0;kc1+pr-c2+pr-c3)/3.0c1+p-c2+p-c3)/3.0) temp1=*pr; temp1.next=p-next; *pr=*p; *p=temp1; pr-next=p; p=p-next; pr=pr-next; p=head; pr=head; return head;student *alter(student *head)student *p=head; char c12;char id12;char name20;int c1,c2,c3;if(head=null)printf(链表为空,没有要删除的对象n);/break;printf(请输入要修改的学号n);scanf(%s,&c);while(p!=null)&(strcmp(c,p-id)!=0)p=p-next;if(strcmp(c,p-id)=0) printf(请输入修改后的学号n);scanf(%s,&id);printf(请输入修改后的姓名n);scanf(%s,&name);printf(请依次输入修改后的高数,英语,物理成绩:);scanf( %d%d%d,&c1,&c2,&c3);strcpy(p-id,id);strcpy(p-name,name);p-c1=c1;p-c2=c2;p-c3=c3;else printf(没找到!);return head;student *readdata(student *head)/读取数据 student *p=null; student *ptr=head; student temp; file *fp=fopen(std.data,
温馨提示
- 1. 本站所有资源如无特殊说明,都需要本地电脑安装OFFICE2007和PDF阅读器。图纸软件为CAD,CAXA,PROE,UG,SolidWorks等.压缩文件请下载最新的WinRAR软件解压。
- 2. 本站的文档不包含任何第三方提供的附件图纸等,如果需要附件,请联系上传者。文件的所有权益归上传用户所有。
- 3. 本站RAR压缩包中若带图纸,网页内容里面会有图纸预览,若没有图纸预览就没有图纸。
- 4. 未经权益所有人同意不得将文件中的内容挪作商业或盈利用途。
- 5. 人人文库网仅提供信息存储空间,仅对用户上传内容的表现方式做保护处理,对用户上传分享的文档内容本身不做任何修改或编辑,并不能对任何下载内容负责。
- 6. 下载文件中如有侵权或不适当内容,请与我们联系,我们立即纠正。
- 7. 本站不保证下载资源的准确性、安全性和完整性, 同时也不承担用户因使用这些下载资源对自己和他人造成任何形式的伤害或损失。
最新文档
- 2022年吉林省长春市中考一模语文试题(解析版)
- 2022年对策题课后阅读材料
- 产科危急重症识别
- 《高等数学》上册课件12-01随机事件
- 幼儿园小班数学教案《晾衣服》
- 2024北京广渠门中学高二9月月考语文试题及答案
- 2025年国际商业管理专业考试卷及答案
- 2025年中小学教师资格考试题及答案
- 2025年公共体育课程期中考试试卷及答案
- 大班健康活动注意饮食
- 早产儿出院后喂养
- 脓毒血症指南解读
- 北京市海淀区101中学2022-2023学年七年级数学第二学期期末质量检测试题含解析
- 混凝土结构工程施工质量验收规范
- GB/T 4956-2003磁性基体上非磁性覆盖层覆盖层厚度测量磁性法
- GB/T 14594-2005无氧铜板和带
- 广东电网“两种人”安规题库-配电“两种人”类(试题及答案)
- 某射击馆照明平面回路设计及智能照明控制分析
- (完整word版)儿童迷宫图 清晰可直接打印
- 土地利用变更调查课件
- DB13T 5181-2020 尾矿库溃坝泥石流数值模拟技术规程
评论
0/150
提交评论