欢迎来到冰点文库! | 帮助中心 分享价值,成长自我!
冰点文库
全部分类
  • 临时分类>
  • IT计算机>
  • 经管营销>
  • 医药卫生>
  • 自然科学>
  • 农林牧渔>
  • 人文社科>
  • 工程科技>
  • PPT模板>
  • 求职职场>
  • 解决方案>
  • 总结汇报>
  • ImageVerifierCode 换一换
    首页 冰点文库 > 资源分类 > DOCX文档下载
    分享到微信 分享到微博 分享到QQ空间

    C课程设计仿照Windows设计计算器.docx

    • 资源ID:13872801       资源大小:196.81KB        全文页数:29页
    • 资源格式: DOCX        下载积分:5金币
    快捷下载 游客一键下载
    账号登录下载
    微信登录下载
    三方登录下载: 微信开放平台登录 QQ登录
    二维码
    微信扫一扫登录
    下载资源需要5金币
    邮箱/手机:
    温馨提示:
    快捷下载时,用户名和密码都是您填写的邮箱或者手机号,方便查询和重复下载(系统自动生成)。
    如填写123,账号就是123,密码也是123。
    支付方式: 支付宝    微信支付   
    验证码:   换一换

    加入VIP,免费下载
     
    账号:
    密码:
    验证码:   换一换
      忘记密码?
        
    友情提示
    2、PDF文件下载后,可能会被浏览器默认打开,此种情况可以点击浏览器菜单,保存网页到桌面,就可以正常下载了。
    3、本站不支持迅雷下载,请使用电脑自带的IE浏览器,或者360浏览器、谷歌浏览器下载即可。
    4、本站资源下载后的文档和图纸-无水印,预览文档经过压缩,下载后原文更清晰。
    5、试题试卷类文档,如果标题没有明确说明有答案则都视为没有答案,请知晓。

    C课程设计仿照Windows设计计算器.docx

    1、C课程设计仿照Windows设计计算器可视化编程技术课程设计 报告题目 仿照Windows系统计算器设计计算器1.引言计算器的产生和发展是建立在电子计算机基础之上的,现代社会很需要一个健全、高效率的计算器。为了提高自己的实践能力和将来开发一个更实用更全能更智能的计算器,以设计与实现计算器为课题。此次设计的计算器应用软件从visualstudio2012编程环境中开发,是一个简单的窗体应用程序,实现简单的计算器功能。以微软自带的计算器为模板,设计了简单易懂的计算器。这款计算器不仅实现了简单的四则运算的功能,还可以进行复杂数学运算,和进制转换(十进制转二进制、八进制、十六进制)。具有简洁的外观,即

    2、时准确的获得所需要要计算的结果,充分降低了数字计算器的难度和所需要的时间,对人们生活和学习具有有很大的帮助。2. 系统设计(1)功能设计本计算器由四大模块,分别为:1.标准计算器(即为主窗口)2.科学型计算器3.程序员计算器(进制转换)4.开发者介绍(2)界面设计主窗口界面(from1)科学型计算器界面(from2)程序员界面(from3)开发者介绍(from4)2.程序实现1.文本框的设置:textBox1.Text = 0;窗口启动前 :Form1.x = 0;/point:1 ;nopoint: 0Form1.a = 0;/1:+ 2:- 3:* 4:/Form1.b = 0;/判D断?

    3、是否执行过运算执行过运算Form1.shu1 = 0;Form1.shu2 = 0;Form1.result = 0;2.按键的设置:数字键及小数点:public static void number(object sender, TextBox textBox1) Button btn = (Button)sender; if (btn.Name = one) if (x = 1)/判断有小数点 textBox1.Text = textBox1.Text + 1; return; if (b != 0) textBox1.Text = 0; b = 0; if (double.Parse(t

    4、extBox1.Text) = 0) textBox1.Text = 1; else textBox1.Text = (textBox1.Text + 1).ToString(); if (btn.Name = two) if (x = 1)/判断有无小数点 textBox1.Text = textBox1.Text + 2; return; if (b != 0) textBox1.Text = 0; b = 0; if (double.Parse(textBox1.Text) = 0) textBox1.Text = 2; else textBox1.Text = (textBox1.Te

    5、xt + 2).ToString(); if (btn.Name = three) if (x = 1)/判断有无小数点 textBox1.Text = textBox1.Text + 3; return; if (b != 0) textBox1.Text = 0; b = 0; if (double.Parse(textBox1.Text) = 0) textBox1.Text = 3; else textBox1.Text = (textBox1.Text + 3).ToString(); if (btn.Name = four) if (x = 1)/判断有无小数点 textBox1.

    6、Text = textBox1.Text + 4; return; if (b != 0) textBox1.Text = 0; b = 0; if (double.Parse(textBox1.Text) = 0) textBox1.Text = 4; else textBox1.Text = (textBox1.Text + 4).ToString(); if (btn.Name = five) if (x = 1)/判断有无小数点 textBox1.Text = textBox1.Text + 5; return; if (b != 0) textBox1.Text = 0; b = 0

    7、; if (double.Parse(textBox1.Text) = 0) textBox1.Text = 5; else textBox1.Text = (textBox1.Text + 5).ToString(); if (btn.Name = six) if (x = 1)/判断有无小数点 textBox1.Text = textBox1.Text + 6; return; if (b != 0) textBox1.Text = 0; b = 0; if (double.Parse(textBox1.Text) = 0) textBox1.Text = 6; else textBox1

    8、.Text = (textBox1.Text + 6).ToString(); if (btn.Name = seven) if (x = 1)/判断有无小数点 textBox1.Text = textBox1.Text + 7; return; if (b != 0) textBox1.Text = 0; b = 0; if (double.Parse(textBox1.Text) = 0) textBox1.Text = 7; else textBox1.Text = (textBox1.Text + 7).ToString(); if (btn.Name = eight) if (x =

    9、 1)/判断有无小数点 textBox1.Text = textBox1.Text + 8; return; if (b != 0) textBox1.Text = 0; b = 0; if (double.Parse(textBox1.Text) = 0) textBox1.Text = 8; else textBox1.Text = (textBox1.Text + 8).ToString(); if (btn.Name = nine) if (x = 1)/判断有无小数点 textBox1.Text = textBox1.Text + 9; return; if (b != 0) tex

    10、tBox1.Text = 0; b = 0; if (double.Parse(textBox1.Text) = 0) textBox1.Text = 9; else textBox1.Text = (textBox1.Text + 9).ToString(); if (btn.Name = zero) if (x = 1)/判断有无小数点 textBox1.Text = textBox1.Text + 0; return; if (b != 0)/两个数的界限判断? textBox1.Text = 0; b = 0; if (double.Parse(textBox1.Text) = 0)

    11、textBox1.Text = 0; else textBox1.Text = (textBox1.Text + 0).ToString(); public void one_Click(object sender, EventArgs e) number(sender, textBox1); public void Form1_Load(object sender, EventArgs e) textBox1.Text = 0; public static void point(object sender, TextBox textBox1) if (double.Parse(textBox

    12、1.Text) = 0) x = 1; textBox1.Text = (textBox1.Text + .).ToString(); public void xiaoshudian_Click(object sender, EventArgs e) point(sender, textBox1); 运算符号1(加减乘除、退格。清零):public static void fuhao2(object sender, TextBox textBox1) Button btnn = (Button)sender; if (btnn.Name = baifenbi) textBox1.Text =

    13、(double.Parse(textBox1.Text) / 100).ToString() + %; if (btnn.Name = genhao) textBox1.Text = (Math.Sqrt(double.Parse(textBox1.Text).ToString(); if (btnn.Name = daoshu) if (double.Parse(textBox1.Text) = 0) MessageBox.Show(零没有倒数!); else textBox1.Text = (1 / double.Parse(textBox1.Text).ToString(); publi

    14、c void baifenbi_Click(object sender, EventArgs e) fuhao2(sender, textBox1); public void 撤销_Click(object sender, EventArgs e) textBox1.Text = textBox1.Text.Remove(textBox1.Text.Length - 1); public void C清零Click(object sender, EventArgs e) textBox1.Clear(); public static void fuhao(object sender, Text

    15、Box textBox1) Button bt = (Button)sender; if (bt.Name = add) x = 0; shu1 = double.Parse(textBox1.Text); a = 1; b = 1; if (bt.Name = subtract) x = 0; shu1 = double.Parse(textBox1.Text); a = 2; b = 2; if (bt.Name = multiply) x = 0; shu1 = double.Parse(textBox1.Text); a = 3; b = 3; if (bt.Name = 除y以) x

    16、 = 0; shu1 = double.Parse(textBox1.Text); a = 4; b = 4; public void add_Click(object sender, EventArgs e) fuhao(sender, textBox1); public static void dengyu(object sender,TextBox textBox1) shu2=double.Parse( textBox1.Text); if(a=1) result = shu1 + shu2; textBox1.Text = result + ; if(a=2) result = sh

    17、u1 - shu2; textBox1.Text = result + ; if(a=3) result = shu1 * shu2; textBox1.Text = result + ; if(a=4) result = shu1 / shu2; textBox1.Text = result + ; public void jieguo_Click(object sender, EventArgs e) dengyu (sender, textBox1); 运算符(科号2学型计算器中所用符号) private void one_Click(object sender, EventArgs e

    18、) Form1.number(sender, textBox1); private void add_Click(object sender, EventArgs e) Form1.fuhao(sender, textBox1); private void jieguo_Click(object sender, EventArgs e) Form1.dengyu (sender, textBox1); if (Form1.a = 4)/sin textBox1.Text = (Math.Sin(Form1.shu1 * Math.PI / 180).ToString(); if (Form1.

    19、a = 5)/cos textBox1.Text = (Math.Cos (Form1.shu1 * Math.PI / 180).ToString(); if (Form1.a = 6)/tan textBox1.Text = (Math.Tan (Form1.shu1 * Math.PI / 180).ToString(); if (Form1.a = 7)/n! double n = 1; for (double i = Form1.a; i 0; i-) n = n * i; textBox1.Text = (n).ToString(); if (Form1.a = 8)/pai te

    20、xtBox1 .Text = (Math.PI) .ToString (); if (Form1 .a =9)/x2 textBox1 .Text =(Math .Pow(double.Parse (textBox1 .Text) ,2) ).ToString (); if (Form1 .a =10)/x3 textBox1 .Text =(Math .Pow(double .Parse (textBox1 .Text ),3) ).ToString (); if (Form1 .a =11)/次方 textBox1 .Text =(Math .Pow( Form1 .shu1 ,Form1

    21、 .shu2 ) ).ToString (); textBox1.Text = Form1.result + ; if (Form1 .a =12)/10x textBox1 .Text =(Math .Pow(10,double .Parse (textBox1 .Text ) ) ).ToString (); if (Form1.a = 13)/3x textBox1.Text = (Math.Pow(double.Parse(textBox1.Text), 1.0 / 3.0).ToString(); / if (Form1 .a =14)/yx / textBox1 .Text = /

    22、if (Form1 .a =15)/ln / textBox1 .Text =(Math .) if (Form1.a = 16)/log textBox1.Text = Math.Log(double.Parse(textBox1.Text), double.Parse(textBox1.Text).ToString(); / if (Form1 .a =17)/e / textBox1 .Text =Math.E private void xiaoshudian_Click(object sender, EventArgs e) Form1.point(sender, textBox1);

    23、 private void 倒数_Click(object sender, EventArgs e) Form1.fuhao2(sender, textBox1); private void 撤消_Click(object sender, EventArgs e) textBox1.Text = textBox1.Text.Remove(textBox1.Text.Length - 1); private void 清零_Click(object sender, EventArgs e) textBox1.Clear(); private void 正弦_Click(object sender

    24、, EventArgs e) Button btn=(Button )sender ; if (btn.Name = 正弦) Form1.x = 0; Form1.shu1 = double.Parse(textBox1.Text); Form1.a = 4;/表示sin 计算 Form1.b = 4; if (btn.Name = 余弦) Form1.x = 0; Form1.shu1 = double.Parse(textBox1.Text); Form1.a = 5;/cos计算 Form1.b = 5; if (btn.Name = 正切) Form1.x = 0; Form1.shu

    25、1 = double.Parse(textBox1.Text); Form1.a = 6;/表示tan 计算 Form1.b = 6; if (btn.Name = 阶乘) Form1.x = 0; Form1.shu1 = double.Parse(textBox1.Text); Form1.a = 7;/ 表示n! Form1.b = 7; if (btn.Name = pai) Form1.x = 0; Form1.shu1 = double.Parse(textBox1.Text); Form1.a = 8;/ 表示 Form1.b = 8; if (btn.Name = 平方) Fo

    26、rm1.x = 0; Form1.shu1 = double.Parse(textBox1.Text); Form1.a = 9; /表示x2 Form1.b = 9; if (btn.Name = 三次方) Form1.x = 0; Form1.shu1 = double.Parse(textBox1.Text); Form1.a = 10; /表示x3 Form1.b = 10; if (btn.Name = 次方) Form1.x = 0; Form1.shu1 = double.Parse(textBox1.Text); Form1.a = 11; /表示xy Form1.b = 11

    27、; if (btn.Name = 十的次方) Form1.x = 0; Form1.shu1 = double.Parse(textBox1.Text); Form1.a = 12; /表示10x Form1.b = 12; if (btn.Name = 开三次方) Form1.x = 0; Form1.shu1 = double.Parse(textBox1.Text); Form1.a = 13; /表示x3 Form1.b = 13; if (btn.Name = 开方) Form1.x = 0; Form1.shu1 = double.Parse(textBox1.Text); Form1.a = 14; /表示 Form1.b = 14; if (btn.Name = ln) Form1.x = 0; Form1.shu1 = double.Parse(textBox1.Text); Form1.a = 15; /表示ln Form1.b = 15; if (btn.Name = log) Form1.x = 0; Form1.shu1 = double.Parse(textBox1.Text); Form1.a = 16; /表示ln F


    注意事项

    本文(C课程设计仿照Windows设计计算器.docx)为本站会员主动上传,冰点文库仅提供信息存储空间,仅对用户上传内容的表现方式做保护处理,对上载内容本身不做任何修改或编辑。 若此文所含内容侵犯了您的版权或隐私,请立即通知冰点文库(点击联系客服),我们立即给予删除!

    温馨提示:如果因为网速或其他原因下载失败请重新下载,重复下载不扣分。




    关于我们 - 网站声明 - 网站地图 - 资源地图 - 友情链接 - 网站客服 - 联系我们

    copyright@ 2008-2023 冰点文库 网站版权所有

    经营许可证编号:鄂ICP备19020893号-2


    收起
    展开