




版权说明:本文档由用户提供并上传,收益归属内容提供方,若内容存在侵权,请进行举报或认领
文档简介
1、.作业名称:学生通讯录管理系统学 院:自动化学院班 级:学 号:姓 名:团队组成:西北工业大学2016年1月16日精品.请填写以下十项内容,将表格按页对齐(插入空行),勿删除任何部分。1、问题与背景(描述程序所要解决的问题或应用背景)一个简易的通讯录管理系统,可以实现对学生信息编辑,查询,保存以及打开的功能,可以用于管理学生的基本信息。2、开发工具(列出所使用的开发工具和第3方开发库)code:block,dev-c+3、主要功能(详细说明程序的功能)每个联系人信息包括该学生的姓名、学号、地址、联系电话、邮编、邮箱。(功能一)编辑通讯录1、增加联系人2、修改联系人3、删除联系人(功能二)查询联
2、系人(1)按学生姓名查询(2)按学生学号查询(功能三)保存通信录(功能四)打开通讯录精品.4、设计内容(详细描述解决问题的原理和方法、算法、数据结构等)程序的流程图如下图5、程序文件与工程名称(标出程序中所有文件名、工程名称及其说明)(1)main.cpp 程序文件(2)学生通讯录管理系统.cbp 工程文件6、函数模块(程序中各个函数的原型声明及其说明)精品.(1)void information:add(string name, string number,string address,string telephone,string post,string mail)实现添加联系人的功能(2
3、)void information:findname(string name)实现查找联系人的功能(3)void information:findnumber(string number)实现查找学号的功能(4)void information:correct(string name)实现对比输入的名字是否与通讯录的一致(5)void information:save()实现保存联系人的功能(6)void information:read()实现打来一个文件读取联系人的功能(7)int main()程序入口7、使用说明(运行程序的小型说明书)(一)编辑通讯录1、增加联系人依次如果输入以下内容(
4、以回车键切换):输入姓名:张三输入学号:2014302257输入地址:西工大长安校区精品.输入电话入邮编:710100输入邮箱:1512486562运行程序如下2、修改联系人除0外,按任意键返回主菜单后选择此项功能。可输入准备修改联系人的名字后,再依次输入更新过后的姓名、学号、地址、联系电话、邮编、邮箱,运行程序如下。精品.3、删除联系人返回主菜单后,选择此项功能后,输入要删除的姓名。如果输入的1姓名不在通讯录里,则打印出“the student can.t be found in the record”。如下图若输入的姓名在通讯录中,就将其删除。(二)查询联系人(1
5、)按学生姓名查询 如果通讯录中没有记录的就打印出找不到的提示。(2)按学生学号查询精品.(三)保存通信录可以将编辑好的通讯录保存成文件,例如保存为文本文档:张三.txt如果保存成功,就打印出保存成功的提示,并且得到如下图所示的txt文档。打开文件显示如下精品.即保存成功。当然也可以保存成其他格式,只需将文件的后缀改变。这里不再赘述。(四)打开通讯录返回主菜单后,选择此项功能,输入要打开的记录名如:张三.txt。运行程序如下。当然也可以自己建立一个文件如:新通讯录.txt。将其和学生通讯录管理系统可执行文件放在同一文件夹下。精品.用程序也可以打开运行如下。8、程序开发总结(简要叙述编写本作业的收
6、获与思考)1、c+对c语言最重要的改进就是增加了类,功能十分强大,编的程序便于维护。通过本次作业,增加了我的编程能力,加深了对类的理解,对c+有了更加深入的了解。2.通过编程实践,我发现编写一个大一点的程序多么复杂,要掌握好c+就必须像老师说的那样多操作,不然水平就提不高。有很多东西你了解了,但当你去编写时,就会不断的暴露我们自己的问题,常常因为自己马虎或者对知识掌握不牢靠,不知道细节问题就常常出错。精品.3.有时候当我们缺乏某个知识点时,可以查阅书籍,还可以上网搜索,甚至在自己的电脑上装msdn可以随时获取帮助文档,同时提高英语水平。4,我认为这并不是一个完美的程序,为了完成课程设计,我只用
7、了6天的时间使用dev-c+做了这个程序。因为它只假设用户按正常的逻辑去使用那些按钮的功能,这样虽然简单了, 但是没有在某些情况下禁用某些按钮,从而使得某种功能的实现必须严谨考虑与其他按钮功能的关系,否则可能会给用户带来不便。要解决这个问题,最好是使用多个对话框来实现,使得其他的无关功能对用户不可见。9、运行截图(附上程序运行的截图画面,至少有1幅,截图越翔实得分越高) 增加联系人修改联系人精品.删除联系人 按学生姓名查询联系人精品.按学生学号查询联系人 保存通讯录精品. 打开通讯录精品.10、源程序(附上程序源代码,若是多个文件,标出文件名)#include#include#include#
8、include using namespace std;static int n=0;struct student string name; string number; string address; string telephone; string post; string mail; class informationprivate: student st10;public: void add(string name, string number,string address,string telephone,string post,string mail); void print(in
9、t i) couttt姓名:endl; couttt学号:sti.numberendl; couttt地址:sti.addressendl; couttt电话:sti.telephoneendl; couttt邮编:sti.postendl; couttt邮箱:sti.mailendl; void findname(string name); void findnumber(string number); void correct(string name); void del(string); void save(); void read(); ; void informati
10、on:add(string name, string number,string address,string telephone,string post,string mail)精品. static int i=0; sti.address=address; sti.mail=mail; =name; sti.number=number; sti.post=post; sti.telephone=telephone; i+; n+; void information:findname(string name) int x=0; for(int i=0;i10;i+) if(s
11、=name) print(i); x=1; break; if(x=0) coutthe man can.t be found in the record!endl; void information:findnumber(string number) int x=0; for(int i=0;i10;i+) if(sti.number=number) print(i); x=1; break; if(x=0) coutthe student can.t be found in the record!endl; void information:correct(string na
12、me)精品. string number; string address; string telephone; string post; string mail; int x=0; for(int i=0;i10;i+) if(=name) coutname; =name; coutnumber; sti.number=number; coutaddress; sti.address=address; couttelephone; sti.telephone=telephone; coutpost; sti.post=post; coutmail; sti.ma
13、il=mail; print(i); x=1; if(x=0) coutthe man can.t be found in the recordendl;void information:del(string name) int x=0; for(int i=0;i10;i+) if(=name)精品. sti.address=0; sti.mail=0; =0; sti.number=0; sti.post=0; sti.telephone=0; x=1; print(i); if(x=0) coutthe student can.t be found in
14、the recordendl; void information:save() string filename;second:coutfilename; ofstream outfile(filename.c_str(); if(!outfile) cerrterror:unable to open output file: filenameendl; goto second; for(int i=0;in;i+) outfile 姓名:t; outfile 学号:sti.numbert; outfile 地址:sti.addresst; outfile 电话号码:sti.te
15、lephonet; outfile 邮编:sti.postt; outfile e_mail:sti.mailendl; outfile.close(); void information:read() vector svec; string filename,s; cinfilename; ifstream infile(filename.c_str(); if(!infile)精品. cerrterror:unable to open output file: filenameendl; while(getline(infile,s) svec.push_back(s); for(vect
16、or:iterator iter=svec.begin();iter!=svec.end();+iter) cout*iterendlendl; int main() information s;couttendl; coutendl; couttttwelcome to use the communication bookendl; coutttttttdesigned: 郭振超endl; couttt-endl;begin:couttt| 1.编辑通信录 2.查询联系人 |endl; couttt| 3.保存通信录 4.打开通记录 |endl; couttt-endl; string na
17、me; string number; string address; string telephone; string post; string mail; int val1; coutval1; switch(val1) case 1: couttt(1) 增加联系人endl; couttt(2) 修改联系人endl; couttt(3) 删除联系人endl; int val2; coutval2; switch(val2) case 1:精品. coutname; coutnumber; coutaddress; couttelephone; coutpost; coutmail; s.a
18、dd(name,number,address,telephone,post,mail); coutback_add; if(back_add!=0) goto begin; else goto end; break; case 2: coutname; s.correct(name); coutback_correct; if(back_correct!=0) goto begin; else goto end; break; case 3: coutname; s.del(name); coutback_del; if(back_del!=0) goto begin; else goto end; break;精品. break; case 2: couttt(1) 按学生姓名查询endl; couttt(2) 按学生学号查询endl; int val3; coutval3; swit
温馨提示
- 1. 本站所有资源如无特殊说明,都需要本地电脑安装OFFICE2007和PDF阅读器。图纸软件为CAD,CAXA,PROE,UG,SolidWorks等.压缩文件请下载最新的WinRAR软件解压。
- 2. 本站的文档不包含任何第三方提供的附件图纸等,如果需要附件,请联系上传者。文件的所有权益归上传用户所有。
- 3. 本站RAR压缩包中若带图纸,网页内容里面会有图纸预览,若没有图纸预览就没有图纸。
- 4. 未经权益所有人同意不得将文件中的内容挪作商业或盈利用途。
- 5. 人人文库网仅提供信息存储空间,仅对用户上传内容的表现方式做保护处理,对用户上传分享的文档内容本身不做任何修改或编辑,并不能对任何下载内容负责。
- 6. 下载文件中如有侵权或不适当内容,请与我们联系,我们立即纠正。
- 7. 本站不保证下载资源的准确性、安全性和完整性, 同时也不承担用户因使用这些下载资源对自己和他人造成任何形式的伤害或损失。
最新文档
- 游艇码头泊位租赁及水上活动策划服务合同
- 新能源汽车技术保障与售后服务补充协议
- 收入增长子女抚养金动态调整合同
- 深海资源开发私募股权投资基金有限合伙人独家合作协议
- 农业产业园农业园区生态保护与可持续发展合作协议
- 绿色建筑碳排放权交易税收优惠合同
- 抖音短视频用户权益保护与投诉处理合同
- 秋季传染病健康教育(小学)
- 护理部护理不良事件分析
- 年产6000吨引发剂A、3000吨双二五硫化剂等精细化工产品项目可行性研究报告写作模板-拿地申报
- 小学生德育教育ppt课件
- 《菱形的判定》教学设计(共3页)
- 配电箱系统图
- 精选静电感应现象的应用练习题(有答案)
- 电缆井工程量计算
- 初中音乐--人声的分类--(1)pptppt课件
- 育种学 第6章杂交育种
- 小作坊生产工艺流程图(共2页)
- 生态瓶记录单
- 钢芯铝绞线参数
- 音王点歌机800S加歌操作方法
评论
0/150
提交评论