收藏 分销(赏)

-C++课程设计《通讯录管理系统》.doc

上传人:人****来 文档编号:4326911 上传时间:2024-09-06 格式:DOC 页数:18 大小:104.01KB
下载 相关 举报
-C++课程设计《通讯录管理系统》.doc_第1页
第1页 / 共18页
-C++课程设计《通讯录管理系统》.doc_第2页
第2页 / 共18页
-C++课程设计《通讯录管理系统》.doc_第3页
第3页 / 共18页
-C++课程设计《通讯录管理系统》.doc_第4页
第4页 / 共18页
-C++课程设计《通讯录管理系统》.doc_第5页
第5页 / 共18页
点击查看更多>>
资源描述

1、课程设计说明书(论文) 课程名称 C+程序设计实践 题 目 通信录管理系统 专 业 软件工程 班 级 学 号 姓 名 xx 起止日期 2013.12.23-2013.27 指导教师 赵新慧 成 绩 辽宁石油化工大学计算机与通信工程学院摘 要 本次课程设计任务是通过编写一个通信录管理系统,学习用VisualC+6.0开发简单的管理系统。采用VisualC+6.0软件为主要开发工具。巩固和加深学生对C+课程的基本知识的理解和掌握,掌握C+编程和程序调试的基本技能,利用C+进行简单软件设计的基本思路和方法,提高运用C+解决实际问题的能力,掌握书写程序设计说明文档的能力使用计算机进行信息管理。实现通信

2、录的管理功能(添加、删除、排序)、按姓名查询的功能,以及把联系人资料保存在文件中,将文件中内容读出来。使用计算机进行系统管理,不仅提高了工作效率,而且大大提高了其安全性,尤其对于复杂的信息管理,计算机能充分地发挥它的优越性,通信录管理系统是每个人不可缺少的部分,在课程设计中,系统开发平台为Windows XP,程序设计语言采用Visual C+,在程序设计中,运用了面向对象解决问题的方法。程序通过调试运行,初步实现了设计目标。Abstract The curriculum design task is through the preparation of a student achieveme

3、nt ranking management system, learning management system with Visual C+ 6 to develop simple. Using Visual C+ 6 software as the main development tool. To consolidate and deepen the students the basic knowledge of C+ course of understanding and master, master the basic skills of C+ programming, the ba

4、sic idea and method of software design using C+, to improve the ability to use C+ to solve practical problems, to master the ability to write program design exposition.The use of computer information management. Realization grade management functions (add, delete, sort), statistical functions (the h

5、ighest score, the lowest score, average score, pass rate), student ID, name, or the name of course query results function, as well as the students scores are stored in the file. The use of computer management system, not only improve the work efficiency, but also greatly improves the safety, particu

6、larly for the complicated information management, computer can give full play toits advantages, student achievement management system is an indispensable part of an education unit, its content but for the policy makers and school managers important. In the curriculum design, system development platf

7、orm for Windows XP, the programming language using Visual C+, in the program design, using object oriented method to solve the problem. Program by debugging and running, initially to achieve the design goals.目 录1设计要求1.1设计题目1.2设计目的1.3设计内容2设计原理和技术3模块设计与分析3.1 添加模块3.2 显示模块3.3 删除模块3.4 查询模块3.5 排序模块3.6 读入文

8、件模块3.7 从文件中读出模块4 程序源代码5功能测试5.1添加功能5.2显示功能5.3删除功能5.4查询功能5.5排序功能5.6保存到文件的功能5.7从文件中读出模块6总结参考文献 指导教师评语:成绩: 指导教师(签字): 年 月 日1设计要求1.1设计题目通信录管理系统1.2设计目的本课程设计是计算机科学与技术专业重要的实践性环节之一,是在学生学习完C+程序设计课程后进行的一次全面的综合练习。本课程设计的目的和任务:(1)巩固和加深学生对C+课程的基本知识的理解和掌握;(2)掌握C+编程和程序调试的基本技能;(3)利用C+进行简单软件设计的基本思路和方法;(4)提高运用C+解决实际问题的能

9、力;(5)掌握书写程序设计说明文档的能力。1.3设计内容以本班同学的具体数据为背景,设计一个本班同学通讯录。实现功能:1) 通讯录编辑(添加、删除)。2) 按不同的项进行查找。3) 对已存在的通讯录按不同的项排序。4) 将通讯录写入文件5) 从文件读入通讯录备注:通讯录至少应该有以下数据项:姓名,地址,电话,邮编,E-mail。2设计原理和技术在课程设计中,系统开发平台为Windows XP,程序设计语言采用Visual C+,在程序设计,采用C+编程语言编写程序,实现各项功能。3模块设计与分析 3.1 添加模块 主要功能是用来添加联系人资料。如果系统有保存联系人资料的情况下,想查看的话,可以

10、直接从系统文件中调用输出,在成功添加联系人资料后,就可以对该联系人进行以上的操作。3.2 显示模块 在程序运行中,通过输入相应选择项,把联系人信息显示在屏幕上。3.3 删除模块 主要功能是用来删除联系人资料。在系统保存联系人资料的前提下,想删除某联系人的资料,可以输入该联系人姓名查找该联系人资料后,就可以删除了。及时对系统进行更新,删除一些没用的信息,可以使系统更加优化。3.4 查询模块 主要功能是用来查找联系人资料。在系统保存了某联系人资料的前提下,想要查找该联系人资料,可以输入该联系人姓名,这样系统就会显示该联系人资料等信息,若系统中不存在则提示用户该联系人不存在。3.5 排序模块 主要功

11、能是用来对联系人的资料按姓名进行排序。便于用户在拨打电话时易于查找一些联系人。3.6 读入文件模块 主要功能是用来将联系人资料读入文件中保存起来进行备份,防止以后丢失。 3.7 从文件中读出模块 主要功能是用来将联系人资料从文件中直接读取到屏幕上,便于查看。4 程序源代码#include#includeusing namespace std;#include#define N 100#define SIZE 20struct student /定义结构体来存储联系人的信息char nameSIZE;char telSIZE;char addSIZE;char posSIZE;char Emai

12、lSIZE;int creat(struct student *p,int n) /创建通讯录int m,i=0;cout添加前的记录,共有:n个endl;cout记录号t姓名t电话t地址t邮编t邮箱endl;while(iname, )!=0)cout i+1ttnametttelttaddttposttEmailendl;i+;p+;coutm; i=0;while(im)cout*endl; cout请输入第i+1个记录endl;coutp-name;coutp-tel;coutp-add;coutp-pos;coutp-Email; cout*endl;coutendlendl;p+;

13、i+;return m+n;void print(struct student *p,int n) /输出通讯录的信息int i=0;if(i=n)cout*通信录中无联系人*endl;elsecout记录号t姓名t电话tt地址t邮编t邮箱endl;while(in)cout i+1tnametteltaddtpostEmailendl;i+;p+;int add(struct student *p,int n) /增加新的联系人int i=0;char c;struct student t,*q;cout添加前的记录:endl; cout姓名t电话tt地址t邮编t邮箱endl;q=p;whi

14、le(in) coutnametteltaddtpostEmailendl;i+;q+;docoutt.name;coutt.tel;coutt.add;coutt.pos;coutt.Email;for(i=0;iname)=0)cout姓名已存在,要重新输入吗(Y/N)?c;if(c=n|c=N) /当用户输入N时,跳出增加操作 break;if(i=n)*(p+i)=t;cout添加后的记录为:endl;cout姓名t电话tt地址t邮编t邮箱endl;for(i=0;in+1;i+)coutnametteltaddtpostEmailendl;while(c=y|c=Y);return

15、n+1;int del(struct student *p,int n) / 删除联系人 int i=0,x; if(i=n)cout*通信录中无联系人*endl;elsechar name10;coutname;for(i=0;iname)=0)break;if(in)for(x=i;xN-1;x+)px=px+1; /依次将后面的联系人资料往前移cout删除后的记录:endl;cout姓名t电话tt地址t邮编t邮箱endl;for(i=0;in-1;i+)coutpi.nametpi.teltpi.addtpi.postpi.Emailendl; return n-1; else cout

16、*无此联系人*endl;return n;void search(struct student *p,int n) /查找联系人int i=0;char name20;if(i=n)cout*通信录中无联系人*endl; else coutname; for(i=0;iname)=0)coutpi.nametpi.teltpi.addtpi.postpi.Emailendl;break;if(i=n)cout*无此联系人*endl;void sort(struct student *p,int n) /对联系人排序struct student temp;int i=0,j;if(i=n)cou

17、t*通信录中没有联系人可排序*endl;else for(i=0;in;i+) for(j=0;j0)temp=pj;pj=pj+1;pj+1=temp; cout排序后的结果为:endl; cout姓名t电话tt地址t邮编t邮箱endl; for(i=0;in;i+) coutpi.nametpi.teltpi.addtpi.postpi.Emailendl;void output_datafile(struct student *p,int n) /输出到文件 fstream iofile;iofile.open(D:student.txt,ios:out);for(int i=0;in;

18、i+)iofilepi.nametpi.teltpi.addtpi.postpi.Emailendl; iofile.close();coutoutput file success!endl;void datafile_screen(struct student *p,int n) /从文件输出到屏幕fstream iofile;iofile.open(D:student.txt,ios:in|ios:binary);cout姓名t电话tt地址t邮编t邮箱p-name;while(!iofile.eof()iofilep-telp-addp-posp-Email;coutnametteltad

19、dtpostEmailp-name;iofile.close();void function(void)struct student recordN;int total=0;int x;couttt*endl;couttt 欢迎登陆通信录管理系统 endl;coutendl;couttt 1 创建联系人 2 输出通信录endl; couttt 3 增加联系人 5 查找联系人 endl;couttt 4 删除联系人 endl;couttt 6 排序 endl;couttt 7 输入到文件 endl;couttt 8 从文件输出到屏幕endl;couttt 9 退出 endl;couttt*end

20、l;docout*endl;coutx; cout*endl;switch(x)case 1: total=creat(record,total);break;case 2: print(record,total); break;case 3: total=add(record,total); break;case 4: total=del(record,total); break;case 5: search(record,total); break;case 6: sort(record,total); break;case 7: output_datafile(record,total)

21、;break;case 8: datafile_screen(record,total);break;case 9: couttt*endl;couttt 谢谢使用通信录管理系统 endl; couttt 再见! endl; couttt*endl;exit(0);while(1);void main()function();5功能测试5.1添加功能 。5.2显示功能 5.3删除功能 5.4查询功能 5.5排序功能5.6保存到文件的功能 5.7从文件中读出模块 实验中遇到的问题及解决方法 在实现添加功能的过程中由于用户可能输入相同的人名,经过一个判断语句后,如果输入了相同的人名则提示用户联系人

22、已存在,是否要重新输入,体现一个人性化的通讯录管理系统。在实现删除的过程中由于没有注意删除联系人后会出现一个空的,导致后面的输出时会出现乱码,经过将后面的依次向前移动,使得该问题得到解决。在实现查找的过程中由于采用的名字查询,而附设的一个名字数组只有10个大小的空间,本来存在的联系人在查询时系统提示所要查询的联系人信息不存在,经过修改之后成功查询。6总结 本学生通信录管理系统由7个模块组成,每个模块相互联系又相互独立。这个通信录管理系统存在着很多不足之处,由于自己本身编程能力的问题,这个系统可以实现的功能非常有限。只能实现通信录管理系统最基本的功能,可以进行简单的输入、输出联系人资料,查询和修

23、改联系人信息,能直接从文件中读入数据,能对系统所作的修改、操作进行保存等。在做之前就看了一些这方面的书,多多少少有一定的了解,使自己在进行的过程中没有胆怯,没有遇到太大的麻烦。这次课程设计,我感到书本上的东西还是很重要的,课程设计,就是离不开书本。在设计过程中,我运用了很的循环、排序,这就要求自己要熟练的掌握for,switch语句,以及各种排序,包括冒泡、选择排序。 另外,通过这次课程设计,我发现文件自己掌握的还不是很熟练,但是随着课程设计的深入,我发现文件对今后的设计十分有用,因此自己一定要对文件多做深入的研究。这次课程设计,自己熟悉了很多的东西,在编写程序的过程中,自己发现了很多的问题,并通过查阅资料,反复实践予以解决,这就使得自己发现问题、解决问题的能力得到了提升。 参考文献C+程序设计实践指导书杜茂康.C+面向对象程序设计(第2版) 北京:电子工业出版社,2011.7

展开阅读全文
部分上传会员的收益排行 01、路***(¥15400+),02、曲****(¥15300+),
03、wei****016(¥13200+),04、大***流(¥12600+),
05、Fis****915(¥4200+),06、h****i(¥4100+),
07、Q**(¥3400+),08、自******点(¥2400+),
09、h*****x(¥1400+),10、c****e(¥1100+),
11、be*****ha(¥800+),12、13********8(¥800+)。
相似文档                                   自信AI助手自信AI助手
搜索标签

当前位置:首页 > 包罗万象 > 大杂烩

移动网页_全站_页脚广告1

关于我们      便捷服务       自信AI       AI导航        获赠5币

©2010-2025 宁波自信网络信息技术有限公司  版权所有

客服电话:4008-655-100  投诉/维权电话:4009-655-100

gongan.png浙公网安备33021202000488号   

icp.png浙ICP备2021020529号-1  |  浙B2-20240490  

关注我们 :gzh.png    weibo.png    LOFTER.png 

客服