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

加入VIP,免费下载
 

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

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

下载须知

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

版权提示 | 免责声明

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

手机通讯录设计.docx

1、手机通讯录设计程序设计报告( 2008/ 2009 学年 第 二 学期)题 目:手机信息管理系统 专 业 微电子 学 生 姓 名 班 级 学 号 B* 指 导 教 师 吴敏 指 导 单 位 计算机学院软件基础教学中心 日 期 2008.6.04 评 分 细 则评分项优秀良好中等差遵守机房规章制度上机时的表现学习态度程序准备情况程序设计能力团队合作精神课题功能实现情况算法设计合理性用户界面设计报告书写认真程度内容详实程度文字表达熟练程度回答问题准确度简 短 评 语教师签名: 年 月 日评分等级备注评分等级有五种:优秀、良好、中等、及格、不及格手机信息管理系统一、课题内容和要求手机信息管理系统是手

2、机通讯的重要功能模块,主要负责对通讯录的录入,修改,删除,查找等功能。通过此课题,熟练掌握文件、数组、指针的各种操作,以及一些算法思想的应用,实现一个简单的手机管理系统。二、需求分析 通讯录包括:(1)通讯录中的每一条信息包括:姓名、电话号码、分类(可能选项有:A为办公类 B为个人类 C为商务类)、电子邮件。(2)通话情况的每一条信息包括:来电号码、去电号码、通话分类(可能选项有:A为已拨、B为已接、C为未接)、来去电时刻、通话时间(调用时间函数)(3)将通讯录和通话情况分别用两个文件存储,文件类型可以是文本文件或是二进制文件。功能需求:1)提供可操作的主菜单:输出个菜单,用于显示以从文件中加

3、载的通讯录信息和若干个可选的功能选项。根据输入的选项来运行不同的功能,运行不同的函数。2)进行文本信息的载入与输出:将信息录入指定的文件实现添加等功能,再从指定的文件中加载通讯录信息实现数据输出。3)查找通讯信息:可以通过查找姓名,通话记录等等进行查找对应的通讯录信息并将它们输出。4)添加通讯录:将希望添加的通讯信息添加到通讯录,注意利用文件进行添加。5)删除通讯录:将希望删除的某个通讯信息删除。会有菜单选项提示,主要也是文件方面的读取并作出处理。6)修改通讯录:输入修改的对象,到文件中查找,由一系列读写函数实现修改过程。7)对现有信息的保存:利用文件把信息保存到文本文档,可对其进行调用,修改

4、等过程。三、概要设计 (1)主要结构体:void menu(); /主菜单的实现函数void menu_1();void menu_1_2();void menu_2();void datein(); /对数据的处理函数void dateout();void rewrite();void deletedate();class Calldate; /通话类结构class Peopledate /通讯录结构 char name10; /姓名 char num20; /号码 char type; /所属类别 char email20; /邮箱(2)主要流程图菜单函数:其间用到指针分配内存,文件的读取

5、,循环的算法。四、源程序代码 #include iostream.h#include string.h#include fstream.h#include windows.h#include conio.hvoid menu(); /菜单的目录实现函数void menu_1();void menu_1_2();void menu_2();int check(char*,char*); /通过指针进行检查void datein(); /输入数据void dateout(); /输出数据void rewrite(); /修改数据void deletedate(); /删除数据class Calld

6、ate; /定义通话类class Peopledate /用类实现对通讯录某个体的信息录入 char name10; char num20; char type; char email20;public: Peopledate(char na10=,char nu20=,char t=A,char em20=) strcpy(name,na); strcpy(num,nu); type=t; strcpy(email,em); char *Getnum()return num; char *Getname()return name; char Gettype()return type; fri

7、end istream & operator(istream &,Peopledate &); friend ostream & operator(ostream &,const Peopledate &); friend void rewrite();ostream & operator(ostream &out,const Peopledate & obj) /重载函数输出信息 if(obj.type=A) out姓名:obj.nameendl号码:obj.numendl邮箱:obj.email endl 类别:办公类endl; else if(obj.type=B) out姓名:obj.

8、nameendl号码:obj.numendl邮箱:obj.email endl 类别:个人类endl; else if(obj.type=C) out姓名:obj.nameendl号码:obj.numendl邮箱:obj.email endl 类别:商务类endl; else out姓名:obj.nameendl号码:obj.numendl邮箱:obj.email endl 类别:不明(istream & in,Peopledate & obj) /重载函数 cout请依次输入:姓名,号码,类别,邮箱。endl; coutobj.name; coutobj.num; coutobj.type;

9、 coutobj.email; return in;class Calldate /定义通话类,用于记录通话的详细内容。 /函数体内由指针,文件,重载实现 int calltype; char num20; int timecost; int time_h; int time_m; int time_s; char type;public: Calldate(int ct=0,char nu20=,int s=0,int th=0,int tm=0,int ts=0,char ty=A) calltype=ct; strcpy(num,nu); timecost=s; time_h=th; t

10、ime_m=tm; time_s=ts; type=ty; friend ostream & operator(ostream &,const Calldate &);ostream & operator(ostream &out,const Calldate & obj) int f=0; if(obj.calltype=1) out去电 endl; else if(obj.calltype=2) out来电 endl; int i=0; Peopledate *date=new Peopledate1000; /用指针存放信息 ifstream inf(people.dat); /打开文件

11、 while(!inf.eof() inf.read(char*)&datei+,sizeof(Peopledate); inf.close(); for(int j=0;ji-1;j+) if(strcmp(obj.num,datej.Getnum()=0) outdatej.Getname()endl; f=1; if(f=0) outobj.numendl; out通话起始时间:obj.time_h点obj.time_m分obj.time_s秒endl; out通话消耗时间:obj.timecost秒endl; if(obj.type=A) out已拨endl; else if(obj.

12、type=B) out已接endl; else if(obj.type=C) out未接endl; else out不明choice; while(choice!=5) switch(choice) case 1: dateout(); break; case 2: datein(); break; case 3: rewrite(); break; case 4: deletedate(); break; menu(); cinchoice; void menu() /显示通讯录菜单 cout*endl; cout 1.查看通讯录信息 endl; cout 2.添加通讯录信息 endl; c

13、out 3.修改通讯录信息 endl; cout 4.删除通讯录信息 endl; cout 5.退出信息管理系统 endl; cout*endl;void menu_1() cout*endl; cout 1.查看某类全部信息 endl; cout 2.查看某人全部信息 endl; cout 3.查看通讯记录 endl; cout 4.返回上级菜单 endl; cout*endl;void menu_1_2() cout*endl; cout 1.查看办公类信息 endl; cout 2.查看个人类信息 endl; cout 3.查看商务类信息 endl; cout 4.返回上级菜单 endl

14、; cout*endl;void menu_2() cout*endl; cout 1.输入联系人信息 endl; cout 2.输入通话记录信息 endl; cout 3.返回上级菜单 endl; cout*choice1; if(choice1=1) int choice12; menu_1_2(); cinchoice12; if(choice12=1) int i=0; Peopledate *date=new Peopledate1000; ifstream inf(people.dat); if(!inf) cout无联系人信息文件endl; return; while(!inf.

15、eof() inf.read(char*)&datei+,sizeof(Peopledate); for(int j=0;ji-1;j+) if(datej.Gettype()=A) coutdatejendl; inf.close(); else if(choice12=2) int i=0; Peopledate *date=new Peopledate1000; ifstream inf(people.dat); if(!inf) cout无联系人信息文件endl; return; while(!inf.eof() inf.read(char*)&datei+,sizeof(People

16、date); for(int j=0;ji-1;j+) if(datej.Gettype()=B) coutdatejendl; inf.close(); else if(choice12=1) int i=0; Peopledate *date=new Peopledate1000; ifstream inf(people.dat); if(!inf) cout无联系人信息文件endl; return; while(!inf.eof() inf.read(char*)&datei+,sizeof(Peopledate); for(int j=0;ji-1;j+) if(datej.Getty

17、pe()=C) coutdatejendl; inf.close(); else return; else if(choice1=2) char na10; coutna; int i=0; Peopledate *date=new Peopledate1000; ifstream inf(people.dat); if(!inf) cout无联系人信息文件endl; return; while(!inf.eof() inf.read(char*)&datei+,sizeof(Peopledate); for(int j=0;ji-1;j+) if(strcmp(datej.Getname()

18、,na)=0) coutdatejendl; inf.close(); else if(choice1=3) int i=0; Calldate *date=new Calldate1000; ifstream inf(call.dat); if(!inf) cout无联系人信息文件endl; return; while(!inf.eof() inf.read(char*)&datei+,sizeof(Calldate); for(int j=0;ji-1;j+) coutdatejchoice2; int i,n; coutn; if(choice2=1) int j=0; Peopleda

19、te *date=new Peopledate1000; ifstream inf(people.dat); if(!inf) cout无联系人信息文件=15) /这里j用于记忆,对于再次添加数据会考虑原有数据的数量。 cout内存不够!总容量不得超过15条!endl; else ofstream ifile(people.dat,ios:ate); if(!ifile) cout无通讯记录文件endl; return; for(i=0;ip0; for(int t=0;tj;t+) if(strcmp(p0.Getname(),datet.Getname ()!=0) flag=1; bre

20、ak; if(flag=1) ifile.write(char*)p,sizeof(Peopledate); else cout已存在!endl; ifile.close(); else if(choice2=2) Calldate *p=new Calldaten; ofstream ifile(call.dat,ios:ate); if(!ifile) cout无通讯记录文件endl; return; for(i=0;in;i+) int cty; char num20; SYSTEMTIME t1,t2; int s; char ty; cout选择通话类型(来电选1,去电选2)cty;

21、 cout请输入电话号码:num; cout现在按任意键开始通话,再按任意键开始结束通话endl; cout按任意键开始通话; getch(); GetLocalTime(&t1); coutendl按任意键结束通话; getch(); GetLocalTime(&t2); s=(t2.wMinute-t1.wMinute)*60; s+=t2.wSecond-t1.wSecond; cout选择通话类型(可能选项有:A为已拨、B为已接、C为未接)ty; Calldate q(cty,num,s,t1.wHour,t1.wMinute,t1.wSecond,ty); pi=q; ifile.w

22、rite(char*)p,sizeof(Calldate)*n); ifile.close(); else return;void rewrite() /修改数据信息 char na10; coutna; int j=0; Peopledate *date=new Peopledate1000; ifstream inf(people.dat); if(!inf) cout无联系人信息文件endl; return; while(!inf.eof() inf.read(char*)&datej+,sizeof(Peopledate); for(int i=0;ij;i+) if(strcmp(datei.Getname(),na)=0) Peopledate newdate; cout请输入被修改人的全部信息:newdate; datei=newdate; ofstream ifile(people.dat); if(!ifile) cout无通讯记录文件endl; return; ifile.write(char*)date,sizeof(Peopledate)*j);

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

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