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

加入VIP,免费下载
 

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

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

下载须知

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

版权提示 | 免责声明

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

计算器报告书VB.docx

1、计算器报告书VB河北联合大学 软件设计基础(VB)课程设计报告设计名称:简易科学计算器姓 名: 学 号:-专业班级:-学 院:-设计时间=设计地点:学校机房成绩:指导教师评语: 指导教师签字: 年 月 日目 录1.课程设计目的 2.课程设计任务与要求 3.课程设计说明书 4.课程设计成果 5.程序调试过程 6.设计问题的不足和改进方案 7.课程设计心得 8.附录 9.参考文献 1课程设计目的软件设计基础(VB)课程设计是这门课程的实践性教学环节之一,本次设计结合实际应用的要求,使课程设计既覆盖VB的知识点,又接近工程实际需要。目的是通过课程设计的综合训练,培养学生实际分析问题、解决问题的能力,

2、以及编程和动手能力,最终目标是通过课程设计这种形式,帮助学生系统掌握VB这门课程的主要内容,养成良好的编程习惯,更好的完成教学任务。2课程设计任务与要求:要求:本次课程设计利用软件设计基础(VB)课程中所学到的编程知识和编程技巧,完成具有一定难度和工作量的程序设计题目,帮助学生掌握编程、调试的基本技能,独立完成所布置的任务。要求:1、对系统进行功能需求分析2、设计合理的数据结构和系统框架3、界面设计美观、清楚、合理4、编程简练,程序功能齐全,能正确运行5、具有一定的创新性6、说明书、流程图要清楚7、课题完成后必须按要求提交课程设计报告任务:1 能够完成数值常数的四则运算及其他函数的求值运算包括

3、sin, cos, tan, exp, log, ln, sqr, 1/x,以及常数e和园周率。2 支持键盘快捷运算(仅要求数字及运算符)。3 因为控件数目较多,要求采用控件数组,以减少事件处理的复杂程度,使程序简洁高效。4 出错处理:操作数如果不符合数学上的定义,应该给出错误信息。例:0做除数,负数或0做真数等情况。3课程设计说明书功能描述1 此程序增加了一个Form2窗体。当在Form1上点击“优先级”按钮时弹出Form2窗体,以实现优先级运算,当在Form2上点击“简易科学”按钮时弹出Form1窗体,以实现简易科学计算2 可以按照题目要求进行数值的四则运算及其他特殊函数的运算。3 五个存

4、储键可以实现数值的存取。4 在Form1窗体中支持键盘快捷运算。5 ON按钮可以进行初始化,清除内存中的数,OFF退出,CE清除显示。6 出错时有提示信息概要设计主要写模块说明,模块结构图,系统流程图(例N-S流程图)(五号,宋体)模块结构图: 根据功能分析,建立系统的体系结构,即将整个系统分解成若干子模块,用框图表示各功能模块之间的接口关系(如下图)。简易文件系统功能框图 详细设计 总体流程图: 各功能模块流程图:1 Select case 流程图 2 控件数组的流程图代码实现详细说明各功能模块的实现过程,所用到的算法、技巧等(附上代码)。如:本系统总共10个窗体:form1form10详细

5、如下:form1、首页作用:“进入应用程序”。所用控件:5个标签,4个时钟。设计思路:用时钟控制label1、2,3,4的运动。单击label1,2,5和命令选择器可进入后面窗体,label3.无链接窗体,无label4 。详细内容:属性较特殊的需要说明。代码如下:本系统总共两个窗体Form1和Form2Form1作用:实现简易科学计算及一些特殊函数的计算。所用控件:40个按钮,1个文本框设计思路:定义e时调用Function函数;计算三角函数时用n*3.14/180(n表示数字)进行弧度和角度的转换;计算对数时用公式b = Log(a) / Log(10);四则运算调用calc(op1,op

6、,op2)进行计算;符号和存储键利用控件数组实现过程代码:Form1的代码:Click事件的代码:Dim n1 As Integer, n2 As Integer, n3 As Integer, n4 As Integer, n5 As IntegerDim m1 As Double, m2 As Double, m3 As Double, m4 As Double, m5 As Double 五个存储键对应的存储数Dim i As Integer, p As Integer, op(100) As Double, j As Integer, k As IntegerDim m As Inte

7、ger, n As Integer, u As Integer, v As Integer, w As IntegerFunction e(ByVal o As Integer, t As Double) As Double 定义e函数e = 1:t = 1For o = 1 To 100t = t / o:e = e + tIf t 1E-24 ThenExit ForEnd IfNext oEnd FunctionPrivate Sub Command1_Click(Index As Integer) 设定各个按纽的功能Dim pi As Double, temp As Double, n

8、i As Double, ki As DoubleDim a As Double, b As Double, c As DoubleIf Index = 18 Then 索引初始化按钮ONn1 = 0:n2 = 0:n3 = 0:n4 = 0:n5 = 0五个存储区都归零Text1.Text = 0 显示区归零i = 0:j = 0:k = 1:m = 1:n = 1:v = 0:u = 0:w = 0op(u) = Text1.TextEnd IfIf Index = 17 Then 索引结束按钮OFFEndEnd IfIf Index = 16 Then 索引清除按钮CEText1.Tex

9、t = 0i = 0:j = 0:k = 1:m = 1:n = 1:v = 0: u = 0: w = 0op(u) = Text1.TextEnd If If Index = 15 Then 索引等号If w = 1 ThenText1.Text = Text1.Text x显示符号ElseIf j = 1 Then j=1代表加Text1.Text = op(u - 1) + op(u)ElseIf j = 2 ThenText1.Text = op(u - 1) - op(u) j=2代表减ElseIf j = 3 ThenText1.Text = op(u - 1) * op(u)

10、j=3代表乘ElseIf j = 4 ThenText1.Text = op(u - 1) / op(u) j=4代表除End Ifu = u + 1 运算数下标的累加v = 0 防止连续连续运算时出现错误End IfEnd IfIf Index = 1 Then 索引数字1If k = 0 ThenText1.Text = 1ElseIf m = 1 Then 小数点前有一位数Text1.Text = Text1.Text * 10 + 1ElseText1.Text = Text1.Text + 1 * 10 (-n)n = n + 1 小数点位数的累加End IfEnd Ifk = k

11、+ 1op(u) = Text1.Text 初值赋给op(u)w = 0: v = 1End IfIf Index = 2 Then 同索引数字1If k = 0 ThenText1.Text = 2ElseIf m = 1 ThenText1.Text = Text1.Text * 10 + 2ElseText1.Text = Text1.Text + 2 * 10 (-n)n = n + 1End IfEnd Ifk = k + 1op(u) = Text1.Textw = 0: v = 1End IfIf Index = 3 Then 同索引数字1If k = 0 Then Text1.

12、Text = 3ElseIf m = 1 ThenText1.Text = Text1.Text * 10 + 3ElseText1.Text = Text1.Text + 3 * 10 (-n)n = n + 1End IfEnd Ifk = k + 1op(u) = Text1.Textw = 0: v = 1End IfIf Index = 4 Then 同索引数字1If k = 0 Then Text1.Text = 4ElseIf m = 1 ThenText1.Text = Text1.Text * 10 + 4Else Text1.Text = Text1.Text + 4 *

13、10 (-n)n = n + 1End IfEnd Ifk = k + 1op(u) = Text1.Textw = 0: v = 1End IfIf Index = 5 Then 同索引数字1If k = 0 ThenText1.Text = 5ElseIf m = 1 ThenText1.Text = Text1.Text * 10 + 5ElseText1.Text = Text1.Text + 5 * 10 (-n)n = n + 1End IfEnd Ifk = k + 1op(u) = Text1.Textw = 0: v = 1End IfIf Index = 6 Then 同索

14、引数字1If k = 0 ThenText1.Text = 6ElseIf m = 1 Then Text1.Text = Text1.Text * 10 + 6Else Text1.Text = Text1.Text + 6 * 10 (-n)n = n + 1End IfEnd Ifk = k + 1op(u) = Text1.Textw = 0: v = 1End IfIf Index = 7 ThenIf k = 0 ThenText1.Text = 7ElseIf m = 1 Then Text1.Text = Text1.Text * 10 + 7ElseText1.Text =

15、Text1.Text + 7 * 10 (-n)n = n + 1End IfEnd Ifk = k + 1op(u) = Text1.Textw = 0: v = 1End IfIf Index = 8 Then 同索引数字1If k = 0 Then Text1.Text = 8ElseIf m = 1 Then Text1.Text = Text1.Text * 10 + 8Else Text1.Text = Text1.Text + 8 * 10 (-n)n = n + 1End IfEnd Ifk = k + 1op(u) = Text1.Textw = 0: v = 1End If

16、If Index = 9 Then 同索引数字1If k = 0 Then Text1.Text = 9ElseIf m = 1 Then Text1.Text = Text1.Text * 10 + 9Else Text1.Text = Text1.Text + 9 * 10 (-n)n = n + 1End IfEnd Ifk = k + 1op(u) = Text1.Textw = 0: v = 1End IfIf Index = 0 Then 同索引数字1If k = 0 ThenText1.Text = 0ElseIf m = 1 Then Text1.Text = Text1.Te

17、xt * 10 + 0Else Text1.Text = Text1.Text + 0 * 10 (-n)n = n + 1End IfEnd Ifk = k + 1op(u) = Text1.Textw = 0: v = 1End IfIf Index = 10 Then 索引小数点m = -1End IfIf Index = 11 Then 索引加号If v = 0 Thenu = u - 1End IfIf j = 1 Then Text1.Text = op(u - 1) + op(u)ElseIf j = 2 Then Text1.Text = op(u - 1) - op(u) E

18、lseIf j = 3 Then Text1.Text = op(u - 1) * op(u)ElseIf j = 4 Then Text1.Text = op(u - 1) / op(u)End IfIf u = -1 Thenu = 0End Ifk = 0op(u) = Text1.Texti = i + 1: j = 1: m = 1: n = 1: u = u + 1: v = 0End IfIf Index = 12 Then 索引减号If v = 0 Thenu = u - 1End IfIf j = 1 Then Text1.Text = op(u - 1) + op(u)El

19、seIf j = 2 ThenText1.Text = op(u - 1) - op(u)ElseIf j = 3 Then Text1.Text = op(u - 1) * op(u)ElseIf j = 4 ThenText1.Text = op(u - 1) / op(u)End IfIf u = -1 Thenu = 0End Ifk = 0op(u) = Text1.Textj = 2: i = 1 + i: m = 1: n = 1: u = u + 1: v = 0End IfIf Index = 13 Then 索引乘号If v = 0 Thenu = u - 1End IfI

20、f j = 1 Then Text1.Text = op(u - 1) + op(u)ElseIf j = 2 ThenText1.Text = op(u - 1) - op(u)ElseIf j = 3 Then Text1.Text = op(u - 1) * op(u)ElseIf j = 4 ThenText1.Text = op(u - 1) / op(u)End IfIf u = -1 Thenu = 0End Ifk = 0op(u) = Text1.Textj = 3: i = i + 1: m = 1: n = 1: u = u + 1: v = 0End IfIf Inde

21、x = 14 Then 索引除号If v = 0 Thenu = u - 1End IfIf j = 1 ThenText1.Text = op(u - 1) + op(u)ElseIf j = 2 ThenText1.Text = op(u - 1) - op(u)ElseIf j = 3 ThenText1.Text = op(u - 1) * op(u)ElseIf j = 4 ThenText1.Text = op(u - 1) / op(u)End IfIf u = -1 Thenu = 0End Ifk = 0op(u) = Text1.Textj = 4: i = i + 1:

22、m = 1: n = 1: u = u + 1: v = 0End IfIf Index = 19 Then 索引sina = Text1.Textb = Sin(a * 3.14 / 180)Text1.Text = bu = u + 1: v = 0: w = 1End IfIf Index = 20 Then 索引cosa = Text1.Textb = Cos(a * 3.14 / 180)Text1.Text = bu = u + 1: v = 0: w = 1End IfIf Index = 21 Then 索引tana = Text1.Textb = Tan(a * 3.14 /

23、 180)Text1.Text = bu = u + 1: v = 0: w = 1End IfIf Index = 22 Then 索引expa = Text1.Textb = Exp(a) Text1.Text = bu = u + 1: v = 0: w = 1End IfIf Index = 24 Then 索引lnIf Text1.Text = 0 ThenMsgBox 0不能为真数ElseIf Text1.Text 0 ThenMsgBox 负数不能为真数Elsea = Text1.Textb = Log(a)Text1.Text = bEnd Ifu = u + 1: v = 0

24、: w = 1End IfIf Index = 23 Then 索引loga = Text1.TextIf Text1.Text = 0 ThenMsgBox 0不能坐真数ElseIf Text1.Text 0 ThenMsgBox 负数不能坐真数Elseb = Log(a) / Log(10)Text1.Text = bEnd Ifu = u + 1: v = 0: w = 1End IfIf Index = 25 Then 索引sqra = Text1.TextIf a 0 ThenMsgBox 负数不能开平方Elseb = Sqr(a)Text1.Text = bu = u + 1: v

25、 = 0: w = 1End IfEnd IfIf Index = 26 Then 索引1/xIf Text1.Text = 0 ThenMsgBox 分母不能为0Elsea = Text1.Textb = 1 / aText1.Text = bEnd Ifu = u + 1: v = 0: w = 1End IfIf Index = 28 Thenpi = 2 求圆周率的函数temp = 2ni = 1Dopi = tempki = 2 * nitemp = temp * (ki / (ki - 1) * (ki / (ki + 1)ni = ni + 1Loop Until Abs(pi

26、- temp) 0.000000000000001text1.text= piIf k = 0 ThenText1.Text = 3.1415926ElseIf m = 1 Then Text1.Text = Text1.Text * 10 + 3.1415926Else Text1.Text = Text1.Text + 3.1415926 * 10 (-n)n = n + 1End IfEnd Ifk = k + 1op(u) = Text1.Textw = 0: v = 1End IfIf Index = 29 Then 索引eIf k = 0 ThenText1.Text = 2.73

27、2ElseIf m = 1 Then Text1.Text = Text1.Text * 10 + 2.732Else Text1.Text = Text1.Text + 2.732 * 10 (-n)n = n + 1End IfEnd Ifk = k + 1op(u) = Text1.Textw = 0 :v = 1End IfIf Index = 31 Then 索引m1If n1 = 0 Thenm1 = Text1.TextElse Text1.Text = m1op(u) = Text1.TextEnd Ifn1 = n1 + 1End IfIf Index = 32 Then 索

28、引m2If n2 = 0 Thenm2 = Text1.TextElseText1.Text = m2op(u) = Text1.TextEnd Ifn2 = n2 + 1End IfIf Index = 33 Then 索引m3If n3 = 0 Thenm3 = Text1.TextElseText1.Text = m3op(u) = Text1.TextEnd Ifn3 = n3 + 1End IfIf Index = 30 Then 索引m4If n4 = 0 Thenm4 = Text1.TextElse Text1.Text = m4op(u) = Text1.TextEnd If

29、n4 = n4 + 1End IfIf Index = 27 Then 索引m5If n5 = 0 Thenm5 = Text1.TextElse Text1.Text = m5op(u) = Text1.TextEnd Ifn5 = n5 + 1End IfEnd SubPrivate Sub Command2_Click()Form1.HideForm2.ShowEnd SubPrivate Sub Form_Load()n1 = 0: n2 = 0: n3 = 0: n4 = 0: n5 = 0五个存储数存储或输出的条件Text1.Text = 0 对各个值和循环条件进行初始化i = 0 : j = 0: k = 1:m = 1:n = 1:v = 0:u = 0:w = 0j的值对应相应的运算符,m是判断

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

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