C++课程设计之电子词典.doc

上传人:灯火****19 文档编号:135216697 上传时间:2020-06-13 格式:DOC 页数:11 大小:196.74KB
返回 下载 相关 举报
C++课程设计之电子词典.doc_第1页
第1页 / 共11页
C++课程设计之电子词典.doc_第2页
第2页 / 共11页
C++课程设计之电子词典.doc_第3页
第3页 / 共11页
C++课程设计之电子词典.doc_第4页
第4页 / 共11页
C++课程设计之电子词典.doc_第5页
第5页 / 共11页
点击查看更多>>
资源描述

《C++课程设计之电子词典.doc》由会员分享,可在线阅读,更多相关《C++课程设计之电子词典.doc(11页珍藏版)》请在金锄头文库上搜索。

1、仲恺农业工程学院工程实训报告电子词典 课程名称 C+面向对象课程设计姓 名 郑志欣院(系) 信息科学与技术学院专业班级 计算机科学与技术132班学 号 201320244215指导教师 史婷婷仲恺农业工程学院教务处制- 0 -目 录1 需求分析12 系统总框图和功能模块说明12.1 系统总框图12.2 功能模块说明13 系统设计23.1 主要结构体23.2主要功能函数23.3 关键函数的流程图24 系统调试25 总结26 源程序清单2- 10 - 1 需求分析 在这个电子词典系统里,我主要是作为一个英汉词典进行,该系统具备简单的英汉词典的功能,使之能提供以下功能:l 单词查找l 单词增除l 单

2、词修改、维护等工作2 系统总框图和功能模块说明2.1 系统总框图电子词典系统单词增加单词修改单词删除保存词典单词查找 根据中文查询根据英文查询2.2 功能模块说明增加单词,完成单词录入;查找单词,完成单词输出;3 系统设计3.1 电子词典源代码#include#include#include#includevoid main() static int n=13; char m; structchar eng50;char ci50;char yin50;char chi50;word1000=cat,n,猫,clean,adj&d&v,1.干净 2.整洁,finally,ad,最终,终于,;i

3、nt();loop:for(;)system(cls);int();coutnt=欢迎进入英汉词典=endl;coutnt *选择项目* nendl;coutnnt 1.增加单词nendl;coutt 2.删除单词nendl;coutt 3.查找单词nendl;coutt 4.修改单词nendl;coutt 5.退出系统nnendl;cout 请选择15选项nendl;coutm;switch(m)case 1:char j10,k15,l10,p30;+n;coutn 增加单词endl;coutj;coutk;coutl;strcpy(wordn.eng,j);strcpy(wordn.ci

4、,k);strcpy(wordn.yin,l);coutn Please check it:;coutnn 英文: wordn.engendl;coutnn 词性: wordn.ciendl;coutnn 中文: wordn.yinendl;coutn 按任意键返回m;break;case 2:char r10;int s,t,z=0,x=0;coutr;for(s=0;s=n;s+)if(s=n-1)if(strcmp(words.eng,r)=0)x=1;for (t=s;tn;t+)strcpy(wordt.eng,wordt+1.eng);strcpy(wordt.ci,wordt+1

5、.ci);strcpy(wordt.yin,wordt+1.yin);elseif(strcmp(wordn.eng,r)=0)z=1;elsez=0;if(z=1|x=1)coutnn 删除成功! nendl;n-;coutn 按任意键返回m;else coutnn 删除失败endl;coutn 按任意键返回m;break;case 3:int l;coutnn 查找单词 nendl;cout 1.通过英文查找 nendl;cout 2.通过中文查找 nendl;coutl;switch(1)case 1: char r10,m1; int s;coutr;for(s=0;s=n;s+)if

6、(s=n-1)if(strcmp(words.eng,r)=0)break;elsecontinue;elseif(strcmp(wordn.eng,r)=0)break;elsechar m1;coutn 按任意键返回m;goto loop;coutnn 英文: words.engendl;coutnn 词性: words.ciendl;coutnn 中文: words.yinendl;coutn 按任意键返回m;break;case 2: char r10,m1; int s;coutr;for(s=0;s=n;s+)if(s=n-1)if(strcmp(words.chi,r)=0)br

7、eak;elsecontinue;elseif(strcmp(wordn.chi,r)=0)break;elsechar m1;coutn 按任意键返回m;goto loop;coutn 英文: words.engendl;coutnn 词性: words.ciendl;coutnn 中文: words.yinendl;coutn 按任意键返回m;break;case 4:char j10,k15,l10,p30,r10,m1;int s;+n;coutn 修改单词 words.engendl;coutr;for(s=0;s=n;s+)if(s=n-1)if(strcmp(words.eng,

8、r)=0)break;elsecontinue;elseif(strcmp(wordn.eng,r)=0)break;elsechar m1;coutn 没有这个单词!n 按任意键返回m;goto loop;coutnn 英文: words.engendl;coutnn 词性: words.ciendl;coutnn 中文: words.yinendl;coutnn 你可以进行修改endl;coutj;coutk;coutl;strcpy(wordn.eng,j);strcpy(wordn.ci,k);strcpy(wordn.yin,l);coutn 确认?;coutnn 英文: wordn.engendl;coutnn 词性: wordn.ciendl;coutnn 中文: wordn.yinendl;coutn 按任意键返回m;break;case 5:exit(1);break;开始3.2 关键函数的流程图显示菜单输入选项 显示查找选项输入删除单词输入单词输入查找英文单词输入词性判断输入查找中文单词 循环体输入中文判断 判断 计算信息显示 循环体循环体 计算计算判断 结束显示查找信息显示无法找到判断 显示查找信息显示无法找到判断显示无法找到显示删除成功

展开阅读全文
相关资源
正为您匹配相似的精品文档
相关搜索

最新文档


当前位置:首页 > 学术论文 > 管理论文

电脑版 |金锄头文库版权所有
经营许可证:蜀ICP备13022795号 | 川公网安备 51140202000112号