在VB中创建一个计算器 [英] creating a calculator in VB

查看:70
本文介绍了在VB中创建一个计算器的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

你好,我想知道是否有人可以给我一些

的建议,从哪里开始上大学的项目我需要设计并创造一只手 - 计算器

模拟Visual Basic.Thankyou!

解决方案

首先抓住自己一个真正的计算器并思考<关于计算器拥有的物理属性(即

a显示和一些按钮)然后建立你的界面

基于你握在手中的对象使用VB的

控制来模拟显示和按钮。


然后开始玩计算器来玩

确切地发现当你与

界面交互时会发生什么,这将开始让你想到

计算器的逻辑(这不是那么简单

首先似乎正确地做到了这一点)


之后我会先解决get的问题在你的应用程序中按

对应命令按钮时正确显示的数字


接下来你要做的事情想想是存储要计算的

值,确定下一个数字按下的

是否应该是新字符串中的第一个

(即按下操作员按钮后*,+, - ,\)

并确定已选择的操作员

然后它只是一个在存储的值上执行计算

并显示结果


在你到达那个阶段之后剩下的你会发现

easy(只需添加额外的功能,例如

内存功能(更多存储和检索来自

变量)和东西'就像百分比(y) * 0.01)方形

root&电源(system.math)


几个月前我建了其中一个并且可以给出

代码,但是嘿,我是谁来破坏你的乐趣; )


祝你好运


问候史蒂夫



< blockquote> *collegestudent < SE *********** @ hotmail.com> scripsit:

你好,我想知道是否有人可以给我一些关于在哪里开始大学项目的建议,我必须设计和创建一个手 - 在Visual Basic中举行计算器模拟.Thankyou!




" hand-held" - 你使用紧凑的框架吗?


-

Herfried K. Wagner [MVP]

< http: //www.mvps.org/dotnet>




非常感谢,这是一个很好的帮助!我已经开始工作了一些代码,我会告诉你完成的结果。再次感谢,

丽贝卡。


***通过Developersdex发送 http://www.developersdex.com ***

不要只是参加USENET ......获得奖励!

hello there, I was wondering if anyone could give me some
advice on where to start on a project for college where I
have to design and create a hand-held calculator
simulation in Visual Basic.Thankyou!

解决方案

First of all grab yourself a real calculator and think
about what physical attributes a calculator posseses (i.e
a display and some buttons) then build your interface
based on the object your holding in your hands using VB''s
controls to simulate the display and buttons.

Then just start to play about with the calculator to
discover exactly what happens when you interact with the
interface this will start to make you think about the
calculators logic (which isn''t quite as simple as it
first appears to do it properly)

after that I would first tackle the problem of getting
the numbers to display correctly when you press the
corrosponding command buttons in your application

The next things you have to think about is storing the
values to be calculated, determining whether or not the
next digit pressed should be the first in the new string
(i.e after an operator button has been pressed *,+,-,\)
and also determining the operator which has been selected
then it''s simply a matter of performing the calculation
on the stored values and displaying the result

after you''ve got to that stage the rest you will find
easy (just adding in the additional functionality such as
memory functions (more storage and retrieval from
variables) and thing''s like percentage (y * 0.01) square
root & power (system.math)

I built one of these a few months back and could give the
code but hey who am I to spoil your fun ;)

Good luck

Regards Steve



* "collegestudent" <se***********@hotmail.com> scripsit:

hello there, I was wondering if anyone could give me some
advice on where to start on a project for college where I
have to design and create a hand-held calculator
simulation in Visual Basic.Thankyou!



"hand-held" -- do you use the compact framework?

--
Herfried K. Wagner [MVP]
<http://www.mvps.org/dotnet>



Thankyou very much, that''s a great help! I''ve started working on a bit
of code, I''ll keep you posted on the finished results. Thanks again,
Rebecca.

*** Sent via Developersdex http://www.developersdex.com ***
Don''t just participate in USENET...get rewarded for it!


这篇关于在VB中创建一个计算器的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆