c++高级语言程序设计课程设计-日历记事本_第1页
c++高级语言程序设计课程设计-日历记事本_第2页
c++高级语言程序设计课程设计-日历记事本_第3页
c++高级语言程序设计课程设计-日历记事本_第4页
c++高级语言程序设计课程设计-日历记事本_第5页
已阅读5页,还剩10页未读 继续免费阅读

下载本文档

版权说明:本文档由用户提供并上传,收益归属内容提供方,若内容存在侵权,请进行举报或认领

文档简介

1、高级语言程序设计(c+)结课设计论文(2015 - 2016年度第一学期)题 b:日历记事本院系:电子与通信工程系班级:通信1503班 制作人:1 引言31.1选题的目的与意义31.2工作流程32需求分析32.1功能需求32.2性能需求33 总体设计33.1基本设计概念和处理流程33.2系统层次模块图43.3对话框的制作44.详细操作54.1创建项目5 4.2详细步骤日历记事本-我的点点滴滴1 引言1.1选题的目的与意义随着科技发展,很少有人继续使用纸和笔来记事、记账了。网络上出现了各种记 事、记账软件,但是很少有集各种功能于一体的多功能记事本。因此,根据自己 的需求,我设计了一个多功能日历记

2、事本。1.2工作流程一、确定选题二、初步构思功能与界面三、进一步精确设计各种功能,绘制功能框架图与 界面设计四、查阅资料五、功能实现、代码编程六、程序完善、界面美化七、撰写课程报告,完成答辩ppt2.需求分析2.1功能需求基于系统需求分析,该系统需要实现以下功能:1)可记录账单,并利用简易计算器进行计算2)对记录一天的摄入与锻炼,督促合理饮食与运动3)对记录一天的心情,写下日记2.2性能需求软件环境:microsoft visual c卄 6.03总体设计3.1基本设计概念和处理流程本系统设计为一个相对开放的单机运行系统。系统界面美观、简单实用、易 操作。木系统采用microsoft visu

3、al c+ 6.0开发,在满足需求的前提下,将系统对 运行环境的性能要求降到最低。系统基本的流程是:登陆一主界面一 选择要打开的一项(记账、锻炼、 日记)。32系统层次模块图登陆我的账小匚二进人,人人爱记录心怙:3.3对话框的制作本系统由多个对话框通过按钮的连接而制成,那么如何制作成一个对话框 呢?(1)给对话框添加按钮(2)给对话框插入菜单(3)设置菜单类向导,选择一个已有的类(4)给菜单设置各项属性(5)设置对话框属性,将菜单与对话框连接(6)给菜单各项和按钮连接代码(7)给按钮连接下一个对话框(8)设计界面布局4 详细操作木系统的详细设计是基于系统需求分析与系统总体设计的结论来进行的,并

4、采用 vc6.0实现各模块的功能。4.1创建项目创建一个基于对话框的mfc appwizard(exe)项目,项目名为“我的点点滴滴”。4.2详细步骤1 登陆界面提示x密码或口令错,诸重新输入?确定 i代码实现:(1) 登陆void cmydlg:ondlbutton()/ todo: add your control notification handler code here cstring sl,s2;m_edit 1 .getwindowtext(s 1);m_edit2.getwindowtext(s2);if(sl="李耀阳“ && s2二二“864544

5、927")csubdlg dig; dlg.domodal();elsemessagebox(”密码或口令错,请重新输入! ”,"提示”);(2) 退出void cmydlg:ontcbutlon()/ todo: add your control notification handler code here onok();2 主界面代码实现:(1) 今日:日历插件,显示今天日期void csubdlg:ontodaybutton()/ todo: add your control notification handler code here m_date = ctime:

6、 :getcurrenttime();updatedata(false);(2) 进入今日:连接下一个子对话框void csubdlg:onenterbutton()/ todo: add your control notification handler code here csubdlg2 dig;dlg.domodal();3进入今日代码实现(此部分主要是连接子对话框):void csubdlg2:onbutton 1 ()/ todo: add your control notification handler code here csubdlg4 dig;dlg.domodal();

7、void csubdlg2:onbutton2()/ todo: add your control notification handler code herecsubdlg6 dig;dlg.domodal();1void csubdlg2:onbutton3()/ todo: add your control notification handler code herecsubdlg7 dig; dlg.domodal();void csubdlg2: :onbutton4()/ todo: add your control notification handler code herecs

8、ubdlg3 dig;dlg.domodal();补充:最前面#include "stdafx.h"#include " tl 历记事本h"include ”subdlg2.h”#include "subdlg3.h"include ”subdlg4.h“include ”subdlg6.h”include ”subdlg7.h”4 我的账单代码实现:(1) 今日总花销:void csubdlg4:onbutton3()/ todo: add your control notification handler code hereupd

9、atedata(true);m edit8=m editl+m edit2+m edit3+m edit4+m edit5+m edit6+m edit7;updatedata(false);(2)剩余:void csubdlg4: :onbutton2()/ todo: add your control notification handler code hereupdatedata(true);m_editl 1 =m_edit9-m_editl0;updatedata(false);(3) 计算器(连接子对话框):void csubdlg4:onbutton 1 ()/ todo: ad

10、d your control notification handler code here csubdlg5 dig;dlg.domodal();5 计算器代码实现:(1)各个按钮的属性on_bn_clicked(idc_0, ono)on_bn_clicked(idc_exit, onexit)on_bn_cl1cked(idc_1, onl)on_bn_clicked(idc_2, on2) 0n_bn_clicked(idc_3, on3) 0n_bn_clicked(idc_4, on4) on_bn_clicked(1dc_5, on5) on_bn_cl1cked(1dc_6, o

11、n6) on_bn_clicked(idc_7, on7) on_bn_clicked(idc_& on8) 0n_bn_clicked(idc_9, on9) on_bn_clicked(1dc_back, on back) on_bn_clicked(idc_cheng oncheng) on_bn_clicked(idc_chu, onchu) on_bn_clicked(idc_clear, onclear) on_bn_clicked(idc_daoshu, ondaoshu) on_bn_clicked(idc_dot, on dot) on_bn_clicked(idc_

12、equal, onequal) on_bn_clicked(idc_jia, onjia) on_bn_clicked(idc_jian, onjian) on_bn_clicked(idc_jj, onjj) on_bn_clicked(idc_qiuyu, onqiuyu) on_bn_clicked(idc_sqrt, onsqrt)(2) 数字键(以0为例)void csubdlg5:ono()/ todo: add your control notification handler code here updatedata(true);if(cal=l)else if(m_edit=

13、',0.h) m_edit=,u;m_edit+=*0'updatedata(false);(3) 功能键1) 删除前一个数字void csubdlg5:onback()/ todo: add your control notification handler code here updatedata(true);m_edit=m_edit.left(m_edit.getlength()-1); updatedata(false);2) 运算符号:加减乘除void csubdlg5:onjia() / todo: add your control notification ha

14、ndler code here updatedata(true);m_strl=m_edit;m_edit=hu;sos= 1;updatedata(false);void csubdlg5: :onjian()/ todo: add your control notification handler code here updatedata(true);m_slrl=m_edit;m_edit=hu;sos=2;updatedata(false);void csubdlg5: :oncheng()/ todo: add your control notification handler co

15、de here updatedata(true);m_strl=m_edit;m_edit=,h;sos=3;updatedata(false);void csubdlg5:onchu()/ todo: add your control notification handler code here updatedata();m_strl=m_edit;m_edit=',h;sos=4;updatedata(false);4) 清除void csubdlg5:onclear()/ todo: add your control notification handler code here

16、updatedata(true);m_edit=,m,;sos=0;updatedata(false);15) 1/x求倒数void csubdlg5:ondaoshu()/ todo: add your control notification handler code here updatedata(true);double fl,f3;m_strl=m_edit;fl=atof(m_strl);if(fl=o)messagebox(m被除数不能为0!n);elsef3=l/fl;m_edit.format("%f',13);updatedata(false);6) 小数

17、点void csubdlg5: :ondot()/ todo: add your control notification handler code here updatedata();m_edit+=".h;cal=l;updatedata(false);7) 等于号二void csubdlg5: :onequal()/ todo: add your control notification handler code here double fl,f2,f3;int f4,f5,f6;/%运算符操作数只能是整型switch(sos)case 1:updatedata(true);m

18、_str2=m_edit;fl=atof(m_strl);f2=atof(m_str2);f3=fl+f2;m_edit.format(h%ff3);updatedata(false);break;case 2:updatedata(true); m_str2=m_edit; fl=atof(m_strl); f2=atof(m_str2);f3=fl-f2;m_edit.format("%f',f3);updatedata(false); break;case 3:updatedata(true); m_str2=m_edit; fl=atof(m_strl); f2=at

19、of(m_str2);f3=flm_edit.format(" %f*,f3);updatedata(false); break;case 4:updatedata(true); m_str2=m_edit;fl=atof(m_strl);f2=atof(m_str2);if(f2=0)messagebox(n被除数不能为零! “); elsef3=fl/f2; m_edit.format(,%f',f3);updatedata(false);break;case 6:updatedata(true);m_str2=m_edit;f4=atoi(m_strl);将字符型转化为

20、整型,下面做相应修改f5=atoi(m_str2);f6=int(f4)%int(f5);m_edit.fonnat("%du,f6);updatedata(false);break;8) +/号void csubdlg5:onjj()/ todo: add your control notification handler code here updatedata(true);if(m_edit.left(l)='-*) 截取 m_strl 左边的第一个字符y m_edit=m_edit.right(m_edit.getlength()-l);elsem_edit='

21、;-,+m_edit;/sos=5;updatedata(false);9) 求余void csubdlg5: :onqiuyu()/ todo: add your control notification handler code here updatedata();m_strl=m_edit;m_edit=,h;sos=6;updatedata(false);110) 平方根void csubdlg5: :onsqrt()/ todo: add your control notification handler code here updatedata(true);double fl,13

22、;m_strl=m_edit;fl=atof(m_strl);if(fl<0)messagebox(m负数没有平方根! “);elsef3=sqrt(fl); m_edit.format("%ff3);1updatedata(false);6 天天爱锻炼今日帳入今日像烁仰豚起尘10个 仰卧起坐30个jd清空清空我的体重早i中i* i个人评价非常棒 还可以 <-勉越蛍强c 枫了代码实现:(1) 添加按钮(仅以左侧两个列表框为例,右侧基本相同) void csubdlg6: :onbutton 1 ()/ todo: add your control notification

23、 handler code here char sfrommenulist50;.gettext(m_listl .getcursel(),sfrommenulist); m_list2.addstring(sfrommenulist);(2) 双击添加void csubdlg6: ondblclklist 1 ()/ todo: add your control notification handler code here char sfromlistf50;m_listl .gettext(m_listl .getcursel(),sfromlist); m_list2.addstring

24、(sfromlist);(3) 删除按钮voidcsubdlg6:onscl()/ todo: add your control notification handler code here cstring item;int index = m_list2.getcursel(); 获取选定顶索引号mist2.gettext(index, item);获取选定顶的文本mist2.deletestring(index);删除一项(4) 清空按钮void csubdlg6:onqkl()/ todo: add your control notification handler code here while(m_list2.getcount()>0)mist2.deletestri ng(0);7记录心情2016 6 17广一般般mb ir厂 flwwr打开保存今日心情广非常好今日51厂“籾记却记录心情3flq代码实现:编辑框文字的保存与读取void csubdlg7:o

温馨提示

  • 1. 本站所有资源如无特殊说明,都需要本地电脑安装OFFICE2007和PDF阅读器。图纸软件为CAD,CAXA,PROE,UG,SolidWorks等.压缩文件请下载最新的WinRAR软件解压。
  • 2. 本站的文档不包含任何第三方提供的附件图纸等,如果需要附件,请联系上传者。文件的所有权益归上传用户所有。
  • 3. 本站RAR压缩包中若带图纸,网页内容里面会有图纸预览,若没有图纸预览就没有图纸。
  • 4. 未经权益所有人同意不得将文件中的内容挪作商业或盈利用途。
  • 5. 人人文库网仅提供信息存储空间,仅对用户上传内容的表现方式做保护处理,对用户上传分享的文档内容本身不做任何修改或编辑,并不能对任何下载内容负责。
  • 6. 下载文件中如有侵权或不适当内容,请与我们联系,我们立即纠正。
  • 7. 本站不保证下载资源的准确性、安全性和完整性, 同时也不承担用户因使用这些下载资源对自己和他人造成任何形式的伤害或损失。

评论

0/150

提交评论