欢迎来到装配图网! | 帮助中心 装配图网zhuangpeitu.com!
装配图网
ImageVerifierCode 换一换
首页 装配图网 > 资源分类 > DOC文档下载
 

c++课程设计学生考勤管理系统报告

  • 资源ID:148148761       资源大小:270KB        全文页数:16页
  • 资源格式: DOC        下载积分:26积分
快捷下载 游客一键下载
会员登录下载
微信登录下载
三方登录下载: 微信开放平台登录 支付宝登录   QQ登录   微博登录  
二维码
微信扫一扫登录
下载资源需要26积分
邮箱/手机:
温馨提示:
用户名和密码都是您填写的邮箱或者手机号,方便查询和重复下载(系统自动生成)
支付方式: 支付宝    微信支付   
验证码:   换一换

 
账号:
密码:
验证码:   换一换
  忘记密码?
    
友情提示
2、PDF文件下载后,可能会被浏览器默认打开,此种情况可以点击浏览器菜单,保存网页到桌面,就可以正常下载了。
3、本站不支持迅雷下载,请使用电脑自带的IE浏览器,或者360浏览器、谷歌浏览器下载即可。
4、本站资源下载后的文档和图纸-无水印,预览文档经过压缩,下载后原文更清晰。
5、试题试卷类文档,如果标题没有明确说明有答案则都视为没有答案,请知晓。

c++课程设计学生考勤管理系统报告

信息科学与技术学院程序设计基础课程设计报告题目名称:学生考勤管理系统学生姓名:郭晨晨学号:2专业班级:13级计科( 3)班指导教师:郭理2013年6月6日目录目录 .1.课程设计题目与要求.1.1课题目的和要求 .1.3课题意义 .2总体设计 .2.1 功能模块设计 .2.2系统设计方案 .3详细设计 .3.1数据结构设计 .3.2主模块设计 .3.2.1建立学生缺课记录子模块 .3.2.2修改学生缺课记录子模块 .3.2.3修改学生缺课记录子模块 .3.2.4查看单科旷课记录子模块 .3.2.5查看学生旷课记录子模块 .3.2.6载入学生旷课记录子模块 .3.2.7储存学生旷课记录子模快 .4.运行结果 .4.1 运行 .5.课程设计总结 .结束语 .参考文献 .附录:源代码.1.课程设计题目与要求1.1课题目的和要求设计目的:要求实现- “学生考勤管理程序”记录学生的缺课情况,它包括:缺课日期、第几节课、课程名称、学生姓名、缺课类型(迟到、早退、请假及旷课)。1.2设计要求:1. 录入学生的缺课记录;2修改某个学生的缺课记录;3查询某个学生的缺课情况;4统计某段时间内,某门课旷课学生姓名及旷课次数,按旷课次数由多到少排序;5统计某段时间内,有学生旷课的课程及旷课人次,按旷课人次由多到少排序;6. 系统以菜单方式工作。1.3课题意义程序实践是本科生重要教学环节之一。通过程序实践,强化学生的计算机应用技能,使学生验证、巩固和充实所学的理论知识,加深对相关内容的理解,拓宽知识面,培养学生的创新精神和实践能力学生考勤管理程序可以大大减缓学生考勤人员的工作量,方便了平时上课学生的出勤率的管理。2总体设计2.1 功能模块设计根据分析整个系统主要划分为 7 个功能模块,分别执行要求中的功能。数据管理中可以对学生的基本信息、课程的基本信息、学生缺课的查询、添加、删除和修改。查询管理通过根据学生姓名,课程姓名时间段儿等信息,查询单个学生的缺课记录,单科课的旷课记录,单个学生的旷课记录。功能模块图如图1 所示:图 1 功能模块图2.2 系统设计方案这个程序是过程性语言设计的。运用多种条件语句,主体采用的是链表指针。系统的设计采用了数组语句、选择语句和循环语句, 在需要处理大量同类数据时, 这样就使程序书写更加简洁。程序使用了布尔函数。选择语句多采用if多分支选择结构与 switch语句。首先计算switch表达式,然后在caes 子句中寻找值相等的常量表达式, 并以此为入口符号, 由此开始顺序执行。 循环语句采用了for语句等、do-while语句, for 语句用于已知循环次数的循环结构,括号中的三个量分别用来表示循环变量初值、循环终值和循环增量。do-while语句先循环后判断,Break语句在switch语句中,保证多分支情况的正确执行,在循环语句中,强制终止本层循环。保存和读取函数是典型的函数功能,一个程序是由若干个函数组成的,保存和读取函数是和其他函数互相调用的。3 详细设计3.1数据结构设计struct xuekechar xueke_name50;int people_num;这是定义了一个xueke 结构体,用来存放一个学科名及其相应的旷课人数;struct student char name50; long time;int lesson_time;char lesson_name50; int chidao_num;int zaotui_num; int qingjia_num; int kuangke_num;struct student *next; 这是定义了一个student的结构体,用来存放一个学生的考勤记录,其中有,字符数组name50 , lesson_name50,分别存放学生名字,缺课课程名字; int型变量 lesson_time,chidao_num,zaotui_num,qingjia_num,kuangke_num,分别来存放,缺课节次,迟到次数,早退次数,请假次数,旷课次数long 型变量 time ,记录时间。3.2主模块设计要建立的学生人数,学生基本信息(包括缺课时间、学生姓名、课程名称、节次、迟到次数、早退次数、请假次数、旷课次数)可用creat ()函数如图1.图 1根据要修改的学生姓名以及科目名称找到相应的信息,再选择要修改的项目进开始char xiugai_name50;char xiugai_xueke_name50;int k;printf(" 请输入要修改的学生姓名与学科名称:");scanf("%s%s",xiugai_name,xiugai_xueke_name);struct student *p1,*p2;p2=(struct student *)malloc(LEN);p1=head;strcmp(xiugai_name,p1->name)!=0&&(p1-p1=p1->next;>next!=NULL)&&strcmp(xiugai_xueke_name,p1->lesson_name)!strcmp(xiugai_name,p1->name)=0&&strcmp(xiugai_xueke_name,p1->lesson_name)=0显示修改菜单选择修改项目并完成修改结束行单项修改如图2图2根据人名可以查出该学生的所有缺课记录如图3图3根据学科名称和时间范围查出所有在该范围内旷课的学生以及次数如图 4图 4根据要查询的学科名称及时间段查出在改时间段内该门课上旷课的人数如图5图 5可以载入实现储存在当前文件夹中txt文件中所储存的数据如图 6开始struct student *p1=NULL,*p2=NULL,*head=NULL;struct student student_ziliao100;int i=0,n=0;打开文件!feof(fp1)将文件里的数据存入结构体数组通过结构体数组建立链表结束图 6进入系统界面,顺序的完成各项操作,进行数据的输入,信息的保存调用相应的函数打开相应的地址,查询各项信息。如图 7图 74.运行结果4.1 运行开始菜单图 1开始菜单主菜单图2主菜单建立学生缺课记录图 2 建立学生缺课记录储存学生旷课记录图 3 储存学生旷课记录5.课程设计总结课程设计顺利完成,题目所要求的功能基本实现,可以对学生的缺课信息进行添加,修改,删除以及查询的显示。不过这个程序还不够完善,例如不能往当前文件夹中的 txt 文件中添加记录。结束语整个系统的设计过程对于我来说是个学习、探索的过程,通过借鉴别人,学习设计程序,在整个设计过程中,出现过很多的问题,很多繁琐的东西都需要反复的修改,主要是因为前期的学习不认真,对系统的需求分析的要求认识不清楚,使得在后边的工作中不得不经常反复请教别人去修改。使我体会到设置中每一步的重要性。所以在分析一个问题时,我们需要站在一个有远见的高度。通过此次设计,我对C+语言编程有了深刻的认识,积累了使用软件工程的思想来开发软件的经验,更重要的是学会了在对待问题时应该考虑到哪些方面和怎么解决问题。虽然时间紧迫但我学会了不少, 感到自身知识的贫乏, 希望在日后积极学习并尝试努力中能做出完善的系统。参考文献谭浩强 .C+语言程序设计 . 清华大学出版社求是科技 .Visual C+ 6.0信息系统开发 . 人民邮电出版社附录:源代码#include<cstdio>/cstdio 是将 stdio.h 的内容用 C+ 头文件的形式表示出来#include<iostream>#include<malloc.h>/malloc 的全称是 memory allocation ,中文叫 动态内存 分配,当无法知道内存具体位置的时候,想要绑定真正的内存空间,就需要用到动态的分配内存。#include<cstring>/当调用库函数,客户程序提供的是string类型参数,而库函数内部实现用的是c-串,因此需要将string对象,转化为char* 对象,而c_str()提供了这样一种方法,它返回一个客户程序可读不可改的指向字符数组的指针。#include<iomanip>/I/O 流控制头文件#define NULL 0#define guding 10#define LEN sizeof(struct student)using namespace std;int student_num;FILE *fp1;struct xuekechar xueke_name50;int people_num;struct student char name50; long time;int lesson_time;char lesson_name50; int chidao_num;int zaotui_num; int qingjia_num; int kuangke_num;struct student *next;void chaxun(struct student *head) int i;char chaxun_name50;cout<<" 请输入要查询的人名: "cin>>chaxun_name;struct student *p;if(head=NULL)cout<<" 联系人为空 "p=head;for(i=0;i<student_num;i+)if(strcmp(chaxun_name,p->name)=0)cout<<" 缺课 时间 :"<<p->time<<"学生姓名 :"<<p->name<<"称:"<<p->lesson_name<<"节次 :"<<p->lesson_time<<endl<<"迟 到 次 数 :"<<p->chidao_num<<"数 :"<<p->zaotui_num<<"请假次数 :"<<p->qingjia_num<<"课程名早 退 次旷课次数:"<<p->kuangke_num<<endl;p=p->next; struct student *xiugai(struct student *head)char xiugai_name50;char xiugai_xueke_name50;int k;cout<<" 请输入要修改的学生姓名与学科名称【格式 : 学生姓名 ( 空格 ) 学科名称】: " cin>>xiugai_name>>xiugai_xueke_name;struct student *p1,*p2;p2=(struct student *)malloc(LEN);p1=head;if(head=NULL)cout<<" 没有学生信息 n"return head; while(strcmp(xiugai_name,p1->name)!=0|strcmp(xiugai_xueke_name,p1->lesson_name)!=0)&&(p1->next!=NULL)p1=p1->next;if(strcmp(xiugai_name,p1->name)=0&&strcmp(xiugai_xueke_name,p1->lesson_name)=0)cout<<"=修改信息=n"cout<<"1- 修改缺课时间n"cout<<"2-修改学生姓名n"n"cout<<"3- 修改课程名称cout<<"4- 修改第几节缺课n"cout<<"5- 修改迟到次数n"cout<<"6-修改早退次数n"cout<<"7-修改请假次数n"cout<<"8-修改旷课次数nn"cout<<"=n"cin>>k;switch(k)case 1:cout<<" 请输入新的缺课时间 :"cin>>p1->time;break;case 2:cout<<" 请输入新的学生姓名 :"cin>>p1->name;break;case 3:cout<<" 请输入新的课程名称 :"cin>>p1->lesson_name;break;case 4:cout<<" 请输入新的缺课节次 :"cin>>p1->lesson_time;break;case 5:cout<<" 请输入新的迟到次数 :"cin>>p1->chidao_num;break;case 6:cout<<" 请输入新的早退次数 :"cin>>p1->zaotui_num;break;case 7:cout<<" 请输入新的请假次数 :"cin>>p1->qingjia_num;break;case 8:cout<<" 请输入新的旷课次数 :"cin>>p1->kuangke_num;break; return head;struct student *creat()int i,b;struct student *head,*p1,*p2;cout<<" 请输入要建立资料的学生人数:"cin>>b;head=p2=NULL;p1=(struct student *)malloc(LEN);cout<<" 【输入格式:缺课时间( 空格 ) 学生姓名 ( 空格 ) 课程名称 ( 空格 ) 第几节 ( 空格) 迟到次数 ( 空格 ) 早退次数 ( 空格 ) 请假次数 ( 空格 ) 旷课次数】 n" cout<<" 请输入第 1 名学生信息 :"cin>>p1->time>>p1->name>>p1->lesson_name>>p1->lesson_time>>p1->chidao_num>>p1 ->zaotui_num>>p1->qingjia_num>>p1->kuangke_num;head=p1;p2=p1;student_num+=1;for(i=1;i<b;i+)p1=(struct student*)malloc(LEN);cout<<" 请输入第 "<<i+1<<" 名学生信息 :"cin>>p1->time>>p1->name>>p1->lesson_name>>p1->lesson_time>>p1->chidao_num>>p1 ->zaotui_num>>p1->qingjia_num>>p1->kuangke_num;p2->next=p1;p2=p1;student_num+=1;p2->next=NULL;return head;void print(struct student *head)struct student *p;p=head;if(p=NULL)cout<<" 没有学生信息while(p!=NULL)n"cout<<"缺课 时间 :"<<p->time<<"学生姓名 :"<<setw(10)<<p->name<<"课程名称 :"<<p->lesson_name<<"节次 :"<<p->lesson_time<<endl<<"迟 到 次 数 :"<<p->chidao_num<<"数 :"<<p->zaotui_num<<"请假次数 :"<<p->qingjia_num<<"早 退 次旷课次数:"<<p->kuangke_num<<endl;p=p->next;struct student *tongji_lesson(struct student *head) struct student *p1,*p2,*p3; char lesson50;long look_time1,look_time2; int xunhuan_num=0; p3=(struct student *)malloc(LEN); if(head=NULL)cout<<" 没有学生信息 "return(head); p1=head; p2=p1->next; while(xunhuan_num<student_num) while(p2!=NULL)if(p2->kuangke_num>p1->kuangke_num)p3->chidao_num=p2->chidao_num;p3->kuangke_num=p2->kuangke_num;p3->qingjia_num=p2->qingjia_num;p3->zaotui_num=p2->zaotui_num;p3->lesson_time=p2->lesson_time;p3->time=p2->time; strcpy(p3->lesson_name,p2->lesson_name); strcpy(p3->name,p2->name);p2->chidao_num=p1->chidao_num;p2->kuangke_num=p1->kuangke_num;p2->qingjia_num=p1->qingjia_num;p2->zaotui_num=p1->zaotui_num;p2->lesson_time=p1->lesson_time;p2->time=p1->time;strcpy(p2->lesson_name,p1->lesson_name);strcpy(p2->name,p1->name);p1->chidao_num=p3->chidao_num;p1->kuangke_num=p3->kuangke_num;p1->qingjia_num=p3->qingjia_num;p1->zaotui_num=p3->zaotui_num;p1->lesson_time=p3->lesson_time;p1->time=p3->time;strcpy(p1->lesson_name,p3->lesson_name);strcpy(p1->name,p3->name);p1=p2;p2=p2->next;p1=head;p2=p1->next;xunhuan_num+;cout<<" 请输入要查看的学科名称:"cin>>lesson;cout<<" 请输入要查看的时间范围【输入格式: 时间 ( 空格 ) 时间】 "cin>>look_time1>>look_time2;p1=head;while(p1!=NULL)if(strcmp(lesson,p1->lesson_name)=0&&look_time1<=p1->time&&p1->time<=look_time2)cout<<"学生姓名:"<<p1->name<<"旷课次数:"<<p1->kuangke_num<<endl; p1=p1->next; return head;struct student *tongji_student(struct student *head) struct xueke a10; int n,i,j,zhongjian; struct student *p1;char zhongjian_name50;long look_time1,look_time2;if(head=NULL)cout<<" 没有学生信息 n"return head;cout<<" 请输入一共的学科数:"cin>>n;for(i=0;i<n;i+)cout<<" 请输入第 "<<i+1<<" 个学科名称: "cin>>ai.xueke_name;ai.people_num=0;cout<<" 请输入要查看的时间范围由小到大【输入格式 : 时间 ( 空格 ) 时间】 " cin>>look_time1>>look_time2;p1=head;for(i=0;i<n;i+)while(p1!=NULL&&look_time1<=p1->time&&p1->time<=look_time2)if(ai.xueke_name=p1->lesson_name)ai.people_num+=p1->kuangke_num;p1=p1->next;p1=head;for(j=0;j<n-1;j+)for(i=0;i<n-1-j;i+)if(ai.people_num<ai+1.people_num) zhongjian=ai+1.people_num; ai+1.people_num=ai.people_num; ai.people_num=zhongjian; strcpy(zhongjian_name,ai+1.xueke_name); strcpy(ai+1.xueke_name,ai.xueke_name); strcpy(ai.xueke_name,zhongjian_name);elseif(ai.people_num=ai+1.people_num&&strcmp(ai.xueke_name,ai+1.xueke_name)>0)zhongjian=ai+1.people_num; ai+1.people_num=ai.people_num; ai.people_num=zhongjian; strcpy(zhongjian_name,ai+1.xueke_name);strcpy(ai+1.xueke_name,ai.xueke_name);strcpy(ai.xueke_name,zhongjian_name);for(i=0;i<n;i+)cout<<" 学科名称 :"<<ai.xueke_name<<"旷课次数 :"<<ai.people_num<<endl;return head;return head;struct student *zairu()struct student *p1=NULL,*p2=NULL,*head=NULL;struct student student_ziliao100;int i=0,n=0;if(fp1=fopen("xueshengziliao.txt","rb+")=NULL) printf("cannot open filen"); return(head); while(!feof(fp1)if(fread(&student_ziliaoi,LEN,1,fp1)!=1)if(feof(fp1)fclose(fp1);break; printf("file read errorn");i+;n=i;student_num=n;p1=p2=(struct student *)malloc(LEN);head=p1;for(i=0;i<n;i+)p1->chidao_num=student_ziliaoi.chidao_num;p1->kuangke_num=student_ziliaoi.kuangke_num; strcpy(p1->lesson_name,student_ziliaoi.lesson_name);p1->lesson_time=student_ziliaoi.lesson_time;strcpy(p1->name,student_ziliaoi.name);p1->qingjia_num=student_ziliaoi.qingjia_num;p1->time=student_ziliaoi.time;p1->zaotui_num=student_ziliaoi.zaotui_num;p2->next=p1;p2=p1;p1=(struct student*)malloc(LEN); p2->next=NULL;return(head);void chucun(struct student *head) struct student *p1; p1=head;fp1=fopen("xueshengziliao.txt","wb+");while(p1!=NULL)fwrite(p1,LEN,1,fp1);p1=p1->next; fclose(fp1);cout<<"储存成功 n"void main()struct student *head;int a,b,c;zhuye: cout<<"$欢迎使用学生考勤管理系统$n"cout<<"1_进入管理 nnn"cout<<"2_查看系统相关信息 nnn"cout<<"$ $nnnnn"cin>>a;if(a=1)docout<<"*n"cout<<"1_建立学生缺课记录 n"cout<<"2_修改学生缺课记录 n"cout<<"3_查询学生缺课记录 n"cout<<"4_查看单科旷课记录 n"cout<<"5_查看学生旷课记录 n"cout<<"6_载入学生旷课记录 n"cout<<"7_储存学生旷课记录 n"cout<<"8_退出考勤管理程序cout<<"*n"cin>>b;switch(b)case 1:head=creat();print(head);break;case 2:head=xiugai(head);print(head);break;case 3:chaxun(head);break;case 4:head=tongji_lesson(head);break;case 5:head=tongji_student(head);break;case 6:head=zairu();print(head);break;case 7:chucun(head);break;while(b!=8);n"elsecout<<"*欢迎使用本系统*n"cout<<"*返回主页请按1*n"cin>>c;if(c=1)goto zhuye;

注意事项

本文(c++课程设计学生考勤管理系统报告)为本站会员(Sc****h)主动上传,装配图网仅提供信息存储空间,仅对用户上传内容的表现方式做保护处理,对上载内容本身不做任何修改或编辑。 若此文所含内容侵犯了您的版权或隐私,请立即通知装配图网(点击联系客服),我们立即给予删除!

温馨提示:如果因为网速或其他原因下载失败请重新下载,重复下载不扣分。




关于我们 - 网站声明 - 网站地图 - 资源地图 - 友情链接 - 网站客服 - 联系我们

copyright@ 2023-2025  zhuangpeitu.com 装配图网版权所有   联系电话:18123376007

备案号:ICP2024067431-1 川公网安备51140202000466号


本站为文档C2C交易模式,即用户上传的文档直接被用户下载,本站只是中间服务平台,本站所有文档下载所得的收益归上传人(含作者)所有。装配图网仅提供信息存储空间,仅对用户上传内容的表现方式做保护处理,对上载内容本身不做任何修改或编辑。若文档所含内容侵犯了您的版权或隐私,请立即通知装配图网,我们立即给予删除!