界面如下图,请模拟计算器设计一个完成简单算术运算功能的计算器程序。 该程序应该具有下列功能:
(1)单击数字按钮输入运算量(在文本框显示)、选择运算符、单击等号按钮在文本框显示运算结果;(2)单击八进制数按钮,把文本框中显示的十进制数转换为八进制数显示在文本框中(...
(1) 单击数字按钮输入运算量(在文本框显示)、选择运算符、单击等号按钮在文本框显示运算结果;
(2) 单击八进制数按钮,把文本框中显示的十进制数转换为八进制数显示在文本框中(可使用Oct 函数);
(3) 单击十六进制数按钮,把文本框中显示的十进制数转换为十六进制数显示在文本框中(可使用Hex 函数);(4) 单击CE按钮,清除本次运算的所有选择(相关变量初始化),在文本框中显示0; 展开
(2) 单击八进制数按钮,把文本框中显示的十进制数转换为八进制数显示在文本框中(可使用Oct 函数);
(3) 单击十六进制数按钮,把文本框中显示的十进制数转换为十六进制数显示在文本框中(可使用Hex 函数);(4) 单击CE按钮,清除本次运算的所有选择(相关变量初始化),在文本框中显示0; 展开
3个回答
展开全部
不知道你要的是什么语言。我这地方也看不到图。
我这有个VBA版本的,不知道你要不要。要的话留下你的邮箱,我发给你;
我这有个VBA版本的,不知道你要不要。要的话留下你的邮箱,我发给你;
追问
VB啊 要 啊 137534155@qq.com
追答
等一会哈,我现在做一个给你。
已经发送,请查收。
怎么还不确认?不是已经给你解决了么?楼主
已赞过
已踩过<
评论
收起
你对这个回答的评价是?
展开全部
我有个JavaScript 的,你看看!
我是qgjlulu@163.com
我是qgjlulu@163.com
追问
不行啊
追答
你要进制转换的?
可以这样想
10进制转成二进制,除二取余,由最后向前排序就行了,其它进制就除相应的数(8进制8,16进制是16(10 用A,11B,12C,13D,14E,15F)
其它进制转换成10进制则可以用各位数值乘以基数(2,8,16)的n-次方(n为从右向左数的位数)的和就行。这说的是整数
小数还没见哪款计算器有
本回答被提问者采纳
已赞过
已踩过<
评论
收起
你对这个回答的评价是?
展开全部
Dim a
Dim fuhao
Private Sub Command1_Click()
Text1.Text = Oct(Val(Text1.Text))
End Sub
Private Sub Command10_Click(Index As Integer)
Text1.Text = Val(Text1) * 10 + 2
End Sub
Private Sub Command11_Click(Index As Integer)
Text1.Text = Val(Text1) * 10 + 3
End Sub
Private Sub Command12_Click(Index As Integer)
Text1.Text = Val(Text1) * 10 + 0
End Sub
Private Sub Command13_Click()
a = Text1.Text
Text1.Text = 0
fuhao = "+"
End Sub
Private Sub Command14_Click()
a = Text1.Text
Text1.Text = 0
fuhao = "-"
End Sub
Private Sub Command15_Click()
a = Text1.Text
Text1.Text = 0
fuhao = "*"
End Sub
Private Sub Command16_Click()
a = Text1.Text
Text1.Text = 0
fuhao = "/"
End Sub
Private Sub Command17_Click()
If fuhao = "+" Then Text1.Text = Val(Text1) + a
If fuhao = "-" Then Text1.Text = a - Val(Text1)
If fuhao = "*" Then Text1.Text = Val(Text1) * a
If fuhao = "/" Then Text1.Text = a / Val(Text1)
End Sub
Private Sub Command18_Click()
Text1.Text = ""
End Sub
Private Sub Command2_Click()
Text1.Text = Hex(Val(Text1.Text))
End Sub
Private Sub Command3_Click(Index As Integer)
Text1.Text = Val(Text1) * 10 + 7
End Sub
Private Sub Command4_Click(Index As Integer)
Text1.Text = Val(Text1) * 10 + 8
End Sub
Private Sub Command5_Click(Index As Integer)
Text1.Text = Val(Text1) * 10 + 9
End Sub
Private Sub Command6_Click(Index As Integer)
Text1.Text = Val(Text1) * 10 + 4
End Sub
Private Sub Command7_Click(Index As Integer)
Text1.Text = Val(Text1) * 10 + 5
End Sub
Private Sub Command8_Click(Index As Integer)
Text1.Text = Val(Text1) * 10 + 6
End Sub
Private Sub Command9_Click(Index As Integer)
Text1.Text = Val(Text1) * 10 + 1
End Sub
Dim fuhao
Private Sub Command1_Click()
Text1.Text = Oct(Val(Text1.Text))
End Sub
Private Sub Command10_Click(Index As Integer)
Text1.Text = Val(Text1) * 10 + 2
End Sub
Private Sub Command11_Click(Index As Integer)
Text1.Text = Val(Text1) * 10 + 3
End Sub
Private Sub Command12_Click(Index As Integer)
Text1.Text = Val(Text1) * 10 + 0
End Sub
Private Sub Command13_Click()
a = Text1.Text
Text1.Text = 0
fuhao = "+"
End Sub
Private Sub Command14_Click()
a = Text1.Text
Text1.Text = 0
fuhao = "-"
End Sub
Private Sub Command15_Click()
a = Text1.Text
Text1.Text = 0
fuhao = "*"
End Sub
Private Sub Command16_Click()
a = Text1.Text
Text1.Text = 0
fuhao = "/"
End Sub
Private Sub Command17_Click()
If fuhao = "+" Then Text1.Text = Val(Text1) + a
If fuhao = "-" Then Text1.Text = a - Val(Text1)
If fuhao = "*" Then Text1.Text = Val(Text1) * a
If fuhao = "/" Then Text1.Text = a / Val(Text1)
End Sub
Private Sub Command18_Click()
Text1.Text = ""
End Sub
Private Sub Command2_Click()
Text1.Text = Hex(Val(Text1.Text))
End Sub
Private Sub Command3_Click(Index As Integer)
Text1.Text = Val(Text1) * 10 + 7
End Sub
Private Sub Command4_Click(Index As Integer)
Text1.Text = Val(Text1) * 10 + 8
End Sub
Private Sub Command5_Click(Index As Integer)
Text1.Text = Val(Text1) * 10 + 9
End Sub
Private Sub Command6_Click(Index As Integer)
Text1.Text = Val(Text1) * 10 + 4
End Sub
Private Sub Command7_Click(Index As Integer)
Text1.Text = Val(Text1) * 10 + 5
End Sub
Private Sub Command8_Click(Index As Integer)
Text1.Text = Val(Text1) * 10 + 6
End Sub
Private Sub Command9_Click(Index As Integer)
Text1.Text = Val(Text1) * 10 + 1
End Sub
已赞过
已踩过<
评论
收起
你对这个回答的评价是?
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询