编制一个四则运算计算器(WEB应用程序使用C#) 10

编制一个四则运算计算器(WEB应用程序使用C#)(1)只有加、减、乘、除4种运算符(2)运算符具有优先级(3)左右括号必须配对,括号的优先级... 编制一个四则运算计算器(WEB应用程序使用C#)(1)只有加、减、乘、除4种运算符(2)运算符具有优先级 (3)左右括号必须配对,括号的优先级 展开
 我来答
百度网友71c4801
2012-02-21
知道答主
回答量:41
采纳率:100%
帮助的人:16.6万
展开全部
因为涉及控件设计,直接给你FRM文件吧。把下面的代码保存到后缀名为.FRM的文件中。
==================
VERSION 5.00
Begin VB.Form Form1
Caption = "Form1"
ClientHeight = 3150
ClientLeft = 60
ClientTop = 390
ClientWidth = 4680
LinkTopic = "Form1"
ScaleHeight = 3150
ScaleWidth = 4680
StartUpPosition = 3 '窗口缺省
Begin VB.CommandButton Command5
Caption = "清除"
Height = 375
Left = 2520
TabIndex = 10
Top = 1440
Width = 855
End
Begin VB.CommandButton Command4
Caption = "÷"
Height = 375
Left = 3000
TabIndex = 9
Top = 960
Width = 375
End
Begin VB.CommandButton Command3
Caption = "×"
Height = 375
Left = 2520
TabIndex = 8
Top = 960
Width = 375
End
Begin VB.CommandButton Command2
Caption = "-"
Height = 375
Left = 3000
TabIndex = 7
Top = 480
Width = 375
End
Begin VB.CommandButton Command1
Caption = "+"
Height = 375
Left = 2520
TabIndex = 6
Top = 480
Width = 375
End
Begin VB.TextBox Text3
Height = 375
Left = 600
Locked = -1 'True
TabIndex = 4
Top = 2040
Width = 1815
End
Begin VB.TextBox Text2
Height = 375
Left = 600
TabIndex = 1
Top = 1320
Width = 1815
End
Begin VB.TextBox Text1
Height = 375
Left = 600
TabIndex = 0
Top = 480
Width = 1815
End
Begin VB.Label Label3
Caption = "运算结果="
Height = 255
Left = 600
TabIndex = 5
Top = 1800
Width = 1095
End
Begin VB.Label Label2
Caption = "请输入第二个数字"
Height = 375
Left = 600
TabIndex = 3
Top = 960
Width = 1575
End
Begin VB.Label Label1
Caption = "请输入第一个数字"
Height = 255
Left = 600
TabIndex = 2
Top = 120
Width = 1815
End
End
Attribute VB_Name = "Form1"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
Private Sub Command1_Click()
Text3.Text = Val(Text1.Text) + Val(Text2.Text)
End Sub

Private Sub Command2_Click()
Text3.Text = Val(Text1.Text) - Val(Text2.Text)

End Sub

Private Sub Command3_Click()
Text3.Text = Val(Text1.Text) * Val(Text2.Text)

End Sub

Private Sub Command4_Click()
Text3.Text = Val(Text1.Text) / Val(Text2.Text)

End Sub

Private Sub Command5_Click()
Text1.Text = ""
Text2.Text = ""
Text3.Text = ""
End Sub
推荐律师服务: 若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询

为你推荐:

下载百度知道APP,抢鲜体验
使用百度知道APP,立即抢鲜体验。你的手机镜头里或许有别人想知道的答案。
扫描二维码下载
×

类别

我们会通过消息、邮箱等方式尽快将举报结果通知您。

说明

0/200

提交
取消

辅 助

模 式