ImageVerifierCode 换一换
格式:DOCX , 页数:20 ,大小:188.83KB ,
资源ID:19683493      下载积分:3 金币
快捷下载
登录下载
邮箱/手机:
温馨提示:
快捷下载时,用户名和密码都是您填写的邮箱或者手机号,方便查询和重复下载(系统自动生成)。 如填写123,账号就是123,密码也是123。
特别说明:
请自助下载,系统不会自动发送文件的哦; 如果您已付费,想二次下载,请登录后访问:我的下载记录
支付方式: 支付宝    微信支付   
验证码:   换一换

加入VIP,免费下载
 

温馨提示:由于个人手机设置不同,如果发现不能下载,请复制以下地址【https://www.bdocx.com/down/19683493.html】到电脑端继续下载(重复下载不扣费)。

已注册用户请登录:
账号:
密码:
验证码:   换一换
  忘记密码?
三方登录: 微信登录   QQ登录  

下载须知

1: 本站所有资源如无特殊说明,都需要本地电脑安装OFFICE2007和PDF阅读器。
2: 试题试卷类文档,如果标题没有明确说明有答案则都视为没有答案,请知晓。
3: 文件的所有权益归上传用户所有。
4. 未经权益所有人同意不得将文件中的内容挪作商业或盈利用途。
5. 本站仅提供交流平台,并不能对任何下载内容负责。
6. 下载文件中如有侵权或不适当内容,请与我们联系,我们立即纠正。
7. 本站不保证下载资源的准确性、安全性和完整性, 同时也不承担用户因使用这些下载资源对自己和他人造成任何形式的伤害或损失。

版权提示 | 免责声明

本文(C++程序实验报告Word文档下载推荐.docx)为本站会员(b****6)主动上传,冰豆网仅提供信息存储空间,仅对用户上传内容的表现方式做保护处理,对上载内容本身不做任何修改或编辑。 若此文所含内容侵犯了您的版权或隐私,请立即通知冰豆网(发送邮件至service@bdocx.com或直接QQ联系客服),我们立即给予删除!

C++程序实验报告Word文档下载推荐.docx

1、不要局限于题目所规定的要求,可以灵活裁减,设计出功能更完善的程序。工作量完成所选题目的程序设计;课程设计说明书工作计划第1次熟悉软件环境。第2次绘制程序流程图。第3次用编写程序。第4次用调试运行程序。第5次编写课程设计说明书参考资料Visual C+面向对象程序设计教程与实验,温秀梅、丁学钧主编,第二版,北京:清华大学出版社,2009.4 1 题目与要求1.1问题提出学生信息包括:学号,姓名,年龄,性别,出生年月,地址,电话,E-mail等。试设计一学生信息管理系统,使之能提供以下功能:系统以菜单方式工作,学生信息录入功能(学生信息用文件保存)输入学生信息浏览功能,输出查询排序功能算法按学号查

2、询按姓名查询学生信息的删除与修改1.2 本系统涉及的知识点结构、指针、循环、数组、函数、宏定义1.3 功能要求1、录入学生信息,每个学生的信息包括:学号、姓名、性别、班级、手机号、邮箱号;2、查询学生信息;3、排序:分别按平均分排序、按学号排序;4、根据学号查询成绩;5、修改学生信息;1.4问题分析定义不同的函数,实现信息管理系统各项功能。其中,学生信息包括:实现功能包括:学生信息录入功能,学生信息浏览功能,查询,排序功能,按学号查询,学生信息的删除与修改等。2 功能设计2.1显示界面2.2 部分模块流程图3 程序代码设计头文件:#include stdafx.h#include /*I/o函

3、数*/stdlib.h /*其他说明*/string.hiostreamusing namespace std;conio.hiomanip#define LEN 30 /*学号和姓名最大学生人数*/#define N 100 /*最大学生人数*/struct student /*声明函数体*/ char code20; /*学号*/ char name10; /*姓名*/ int age; /*年龄*/ char sex5; /*性别*/ char time20; /*出生年月*/ char add20; /*家庭地址*/ char tel20; /*电话*/ char mail20; /*

4、邮箱地址*/stuN;int k=1,m,n;student *shuru_information(student *);student *chaxun_information(student *);student *xiugai_information(student *);student *zengjia_information(student *);student *shanchu_information(student *);student *xianshi_information(student *);student *baocun_information(student *);st

5、udent *caidan_information(student *);student *tuichuxitong_information(student *);student *huanyingyemian_information(student *);student *help_information(student *);student *paixu_information(student *);主函数:int main() student *head; while(k) head=huanyingyemian_information(head); system(pause);cls

6、cout请按任意键进入主菜单!endl; head=caidan_information(head); return 0;系统帮助说明函数:student *help_information(student *head)COLOR 3fn 尊敬的用户您好! / coutn = | |coutn 1.欢迎进入帮助系统! 2.请按照菜单提示进入数字代号! 3.增加学生信息后,请切记保存! 4.谢谢您的使用! = ; return(head);学生信息输入函数:student *shuru_information(student *head) /* 实现录入学生基本信息功能 */ int i,fla

7、g=1; while(flag) flag=0;请输入需要创建信息的学生人数(1-100): scanf(%d,&n); if(n100) flag=1;输入错误,检查后请重新输入!endl; for(i=0;istui.code;请输入姓名:stui.name; getchar();请输入性别(男,女):stui.sex;请输入年龄:stui.age;请输入出生年月(输入格式:年.月):stui.time;请输入家庭地址:stui.add;请输入电话号码:stui.tel;请输入E-mail地址:stui.mail;录入完毕! head=baocun_information(head);st

8、udent *baocun_information(student *head) /*保存学生信息到文件的函数*/ int i; FILE *fp; if(fp=fopen(student.txt,wb)=NULL) /*创建文件并判断是否能够打开成功*/文件不能打开! exit(0); /*如果不能打开文件,则关闭当前所有的文件*/i+) /*将内存中的学生信息写入到磁盘文件中*/ if(fwrite(&stui,sizeof(struct student),1,fp)!=1)文件输入错误! fclose(fp);学生信息查询:student *chaxun_information(stud

9、ent *head) int i,t,flag; char s130;COLOR 5fn =n | 1.按学号查询 |n | 2.按姓名查询 |n | 3.退出本菜单 |n =nwhile(1) 请输入子菜单编号:cint; switch(t)case 1: 请输入要查询的学生的学号: ns1; if(strcmp(stui.code,s1)=0)学生学号 stui.code;n学生姓名 n年龄 n性别 n出生年月 n家庭地址 n电话 nE-mail if(flag=0)该学号不存在!break;case 2: 请输入要查询的学生的姓名: if(strcmp(stui.name,s1)=0)学

10、生学号 学生姓名 年龄 性别 出生年月 家庭地址 电话 E-mail n=n%6s %7s %6d %5s %9s %8s %10s %14sn, stui.code,stui.name,stui.age,stui.sex,stui.time,stui.add,stui.tel,stui.mail;该姓名不存在!case 3: return (head); default:请在1-3之间选择nreturn(head);修改学生信息:student *xiugai_information(student *head) int i,t,num; char sex13,s130,s230; num=

11、i;COLOR 4f =n | 1.修改姓名 |n | 2.修改年龄 |n | 3.修改性别 |n | 4.修改出生年月 |n | 5.修改地址 |n | 6.修改电话号码 |n | 7.修改E-mail |n | 8.修改退出本菜单 |n while(1)请输入子菜单的编号: case 1:请输入新的姓名:s2; strcpy(stunum.name,s2); case 2:请输入新的年龄:stunum.age; case 3: case 4:请输入新的出生年月: strcpy(stunum.time,s2);break; case 5:请输入新的地址: strcpy(stunum.add,

12、s2); case 6:请输入新的电话号码: strcpy(stunum.tel,s2); case 7:请输入新的E-mail: strcpy(stunum.mail,s2); case 8:请在1-8之间选择n return(head);对学生信息进行排序:student *paixu_information(student *head) int i,j,*p,*q,s; char temp10;n-1; for(j=n-1;ji;j-) if(strcmp(stuj-1.code,stuj.code)0) strcpy(temp,stuj-1.code); strcpy(stuj-1.c

13、ode,stuj.code); strcpy(stuj.code,temp); strcpy(temp,stuj-1.name); strcpy(stuj-1.name,stuj.name); strcpy(stuj.name,temp); strcpy(temp,stuj-1.sex); strcpy(stuj-1.sex,stuj.sex); strcpy(stuj.sex,temp); strcpy(temp,stuj-1.time); strcpy(stuj-1.time,stuj.time); strcpy(stuj.time,temp); strcpy(temp,stuj-1.ad

14、d); strcpy(stuj-1.add,stuj.add); strcpy(stuj.add,temp); strcpy(temp,stuj-1.tel); strcpy(stuj-1.tel,stuj.tel); strcpy(stuj.tel,temp); strcpy(temp,stuj-1.mail); strcpy(stuj-1.mail,stuj.mail); strcpy(stuj.mail,temp); p=&stuj-1.age; q=&stuj.age; s=*p; *p=*q; *q=s; return(head);增加学生信息:student *zengjia_in

15、formation(student *head) int i=n,j,flag;请输入将要增加的学生数目:m; do请输入第%d个学生的学号: for(j=0;jj+) if(strcmp(stui.code,stuj.code)=0)该学号已经存在,请仔细核查后重新输入!请输入第%d个学生的学生姓名:请输入第%d个学生的学生年龄:请输入第%d个学生的学生性别:请输入第%d个学生的学生出生年月:(格式:年,月,日)n请输入第%d个学生的学生家庭地址:请输入第%d个学生的学生电话:请输入第%d个学生的学生E-mail:if(flag=0) i+; while(in+m); n=n+m;输入完毕!

16、nnhead=paixu_information(head);删除学生信息:student *shanchu_information(student *head) int i,j,flag=0; char s115;请输入将要删除的学生的学号: for(i=1; for(j=i; stuj=stuj+1;if(flag=1)删除成功!显示结果请按6! n-;return(head);student *xianshi_information(student *head)rb)=NULL)打开文件时错误!请按任意键退出! 所有学生的信息为:n n学生学号 学生姓名 年龄 性别 出生年月 家庭地址

17、电话 E-mail =i+) fread(&stui,sizeof(struct student),1,fp); stui.code,stui.name,stui.age,stui.sex,stui.time,stui.add,stui.tel,stui.mail;退出系统:student *tuichuxitong_information(student *head) system( -【学生信息管理系统】-n 指导老师:郝伟 n Bye-Byen n n n 安 物 n 徽 联 n 理 网 n 工 工 n 大 工 n 学 程 n 一 n 班 n 谢谢使用n显示主界面:student *huanyingyemian_information(student *head) system(COLOR 6f

copyright@ 2008-2022 冰豆网网站版权所有

经营许可证编号:鄂ICP备2022015515号-1